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
Having issues w/ script
str4wberrypanic Offline
Member

Posts: 241
Threads: 24
Joined: Jul 2012
Reputation: 8
#1
Having issues w/ script

Hello guys. I'm having a little problem with a script. This is what's supposed to happen:

The player picks up an item on map A and then he collides with a script area on map B. The script area on map B checks if the player has the item, and if he has, a clock plays a sound. If he hasn't the item, then nothing happens.
This is the script i'm using:



////////////////////////////
// Run first time starting map
void OnStart()

{

AddEntityCollideCallback("Player", "Start_Clock_Area", "Clock_Event", false, 1);

}

void Clock_Event(string &in asParent, string &in asChild, int alState)
{
if(HasItem("item_screwdriver_2"))
{
AddTimer("", 0.1f, "Useless_Timer");
PlaySoundAtEntity("", "Clock_Chimes", "clock_grandfather_2", 0, false);
}

else
{
return;
}
}

void Useless_Timer(string &in asTimer)
{
RemoveEntityCollideCallback("Player", "Start_Clock_Area");
}






There's also a timer to remove the collision because i want the event to happen only once. I tested this script and nothing happens even if i have the item in the inventory. Any help will be apreciated.

12-15-2013, 09:52 PM
Find


Messages In This Thread
Having issues w/ script - by str4wberrypanic - 12-15-2013, 09:52 PM
RE: Having issues w/ script - by RaideX - 12-15-2013, 09:57 PM
RE: Having issues w/ script - by str4wberrypanic - 12-15-2013, 10:22 PM
RE: Having issues w/ script - by RaideX - 12-15-2013, 10:35 PM
RE: Having issues w/ script - by str4wberrypanic - 12-15-2013, 10:43 PM
RE: Having issues w/ script - by Daemian - 12-15-2013, 11:00 PM
RE: Having issues w/ script - by str4wberrypanic - 12-15-2013, 11:06 PM
RE: Having issues w/ script - by Daemian - 12-15-2013, 11:54 PM
RE: Having issues w/ script - by Romulator - 12-16-2013, 12:54 AM
RE: Having issues w/ script - by str4wberrypanic - 12-18-2013, 12:48 AM
RE: Having issues w/ script - by Traggey - 12-19-2013, 10:47 PM



Users browsing this thread: 1 Guest(s)