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 teleport script fatal error
Science Offline
Junior Member

Posts: 9
Threads: 0
Joined: Jun 2012
Reputation: 0
#4
RE: teleport script fatal error

//Error code

void OnStart()
}
AddEntityCollideCallback("Player","TeleportScript", string& asChildName, "NailThatSucker", true, 1);
{

void NailThatSucker:(string& asParent, string &in asChild, int alStates);
{
-snip-
}


You didn't declare this, instead, you made a new section to the string. Look at the curly braces, { opens and } closes, you have it the other way around in your void OnStart() area. Also, in your function you added a colon ( : ) where it doesn't belong, and a semi-colon doesn't go at the end of a function.



//Good code

void OnStart()
{

AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}


void NailThatSucker(string& asParent, string &in asChild, int alStates)
{
SetEntityActive("TeleportedNakedGuy", true);
AddPropForce("TeleportedNakedGuy", -10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportedNakedGuy", 0, false);
}

I'm smart enough to know that I'm dumb.
(This post was last modified: 06-10-2012, 09:29 PM by Science.)
06-10-2012, 09:28 PM
Find


Messages In This Thread
teleport script fatal error - by putty992 - 06-10-2012, 09:00 PM
RE: teleport script fatal error - by Science - 06-10-2012, 09:28 PM
RE: teleport script fatal error - by putty992 - 06-10-2012, 09:30 PM



Users browsing this thread: 2 Guest(s)