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: Monster spawns when picked up a key
jakeni96 Offline
Junior Member

Posts: 3
Threads: 1
Joined: Feb 2012
Reputation: 0
#1
Script help: Monster spawns when picked up a key

So, I'm making my own custom story right now, and im trying to make a monster spawn exactly when you pick up a key. I've tried to make it work a couple of times, but still no results.

If anyone knows how to fix this, tell me.
06-30-2012, 07:09 PM
Find
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#2
RE: Script help: Monster spawns when picked up a key

There are multiple ways to do this, I prefer this one.


void OnStart()
{
SetEntityCallbackFunc("NAMEofKEY", "OnPickup");
}
void OnPickup(string &in asEntity, string &in type)
{
if(asEntity == "NAMEofKEY")
{
SetEntityActive("NAMEofYOURMONSTER", true);
}
}


Just make sure to UNCHECK "active" under the monstername in the level editor.
06-30-2012, 07:36 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#3
RE: Script help: Monster spawns when picked up a key

we could fix it better when you post your try, so we can just correct it and you'll see what you did wrong.

Think, before you speak Google, before you post
06-30-2012, 07:36 PM
Find
jakeni96 Offline
Junior Member

Posts: 3
Threads: 1
Joined: Feb 2012
Reputation: 0
#4
RE: Script help: Monster spawns when picked up a key

I got it working now BTW, i just did the string wrong.
07-01-2012, 11:32 AM
Find




Users browsing this thread: 1 Guest(s)