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
Script Help My one scripting weakness
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: My one scripting weakness

void OnStart()
{
AddTimer("Repeat", 5, "RepeatTimer") //This creates a timer that calls after 5 seconds
}

void RepeatTimer(string &in asTimer) //The timer
{
if(asTimer == "Repeat")
{
AddLocalVarInt("Repeat", 1); //This adds 1 to the LocalVarInt "Repeat".
AddTimer("Repeat", 5, "RepeatTimer") //This creates a timer that calls after 5 seconds

}

if(GetLocalVarInt("Repeat") == 5) //If the timer has repeated 5 times...
{
Function(); //The stuff you want to do
}
}

Trying is the first step to success.
10-16-2012, 06:26 PM
Find


Messages In This Thread
My one scripting weakness - by Bennick - 10-16-2012, 05:46 PM
RE: My one scripting weakness - by FlawlessHappiness - 10-16-2012, 06:26 PM
RE: My one scripting weakness - by The chaser - 10-16-2012, 06:27 PM
RE: My one scripting weakness - by The chaser - 10-16-2012, 08:48 PM



Users browsing this thread: 1 Guest(s)