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
I need help with this script
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#5
RE: I need help with this script

(01-13-2013, 05:39 AM)Damascus Wrote: There's a plethora of problems here. Added script is red, corrected script is blue:

(01-12-2013, 09:18 PM)DanielStanley Wrote: Hey. So i made this script and i can't get it to work, does anyone know how to fix this? (I'm pretty new to this script thing)

////////////////////////////
// Run first time starting map
void OnStart()
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i< 10;i++) {
GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}


// Start of everything!

AddEntityCollideCallback("Player", "ENTITY COLLIDED WITH", "introscript", false, 0);
}
void introscript(string &in asParent, string &in asChild, int alState)
{

if(alState == 1)
{
PlayMusic("03_puzzle_secret", false, 1, 0, 5, true);
}
if(alState == -1)
{
StopMusic(0, 5);
}
}

it won't work like that, Damascus. the closing bracket for OnStart comes after the collidecallback. your second closing bracket is wrong.

(and you don't need brackets when using a for-loop with just one instruction Smile )
(This post was last modified: 01-13-2013, 09:10 AM by darksky.)
01-13-2013, 09:09 AM
Find


Messages In This Thread
I need help with this script - by DanielStanley - 01-12-2013, 09:18 PM
RE: I need help with this script - by The chaser - 01-12-2013, 10:59 PM
RE: I need help with this script - by NaxEla - 01-13-2013, 12:25 AM
RE: I need help with this script - by Damascus - 01-13-2013, 05:39 AM
RE: I need help with this script - by darksky - 01-13-2013, 09:09 AM



Users browsing this thread: 1 Guest(s)