The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crowbar script
Bozcovich Offline
Junior Member

Posts: 11
Threads: 2
Joined: Jan 2012
Reputation: 0
#1
Crowbar script

Hey, I'm trying to make a crowbar/destroying door script, but i keep getting error,


Whats wrong with this code? Big Grin




void OnStart()

{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
{
AddUseItemCallback("1", "crowbar_1", "Mansion_1", UseCrowbarOnDoor, true);
}
void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ghostgrunt", true);
ShowEnemyPlayerPosition("ghostgrunt");
AddTimer("", 1, "TimerGruntEnd");
StartPlayerLookAt("AreaLookAt", 30, 50, "");
AddTimer("", 1, "TimerStopPlayerLook");
}


Void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_1", true);
RemoveItem(asItem);
}
void TimerStopPlayerLook (string &in asTimer)
{
SetEntityActive("ghostgrunt", false);
StopPlayerLookAt();
SetEntityActive("servant_grunt_1", true);
}






This is my code without the crowbar script and it works fine:



void OnStart()

{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ghostgrunt", true);
ShowEnemyPlayerPosition("ghostgrunt");
AddTimer("", 1, "TimerGruntEnd");
StartPlayerLookAt("AreaLookAt", 30, 50, "");
AddTimer("", 1, "TimerStopPlayerLook");
}

void TimerStopPlayerLook (string &in asTimer)
{
SetEntityActive("ghostgrunt", false);
StopPlayerLookAt();
SetEntityActive("servant_grunt_1", true);
}


Big Grin
(This post was last modified: 01-17-2012, 06:40 PM by Bozcovich.)
01-17-2012, 01:37 AM
Find


Messages In This Thread
Crowbar script - by Bozcovich - 01-17-2012, 01:37 AM
RE: Crowbar script - by flamez3 - 01-17-2012, 02:24 AM
RE: Crowbar script - by Shadowfied - 01-17-2012, 09:35 AM
RE: Crowbar script - by Bozcovich - 01-17-2012, 03:55 PM
RE: Crowbar script - by Bozcovich - 01-17-2012, 05:19 PM
RE: Crowbar script - by Shadowfied - 01-17-2012, 05:27 PM
RE: Crowbar script - by Bozcovich - 01-17-2012, 05:31 PM
RE: Crowbar script - by SilentStriker - 01-17-2012, 05:58 PM
RE: Crowbar script - by Bozcovich - 01-17-2012, 06:13 PM
RE: Crowbar script - by flamez3 - 01-17-2012, 06:16 PM
RE: Crowbar script - by Bozcovich - 01-17-2012, 06:27 PM



Users browsing this thread: 1 Guest(s)