assassinhawk45
Junior Member
Posts: 31
Threads: 11
Joined: Dec 2012
Reputation:
0
|
Levers
I'm having trouble with scripting a lever. I'm am trying to make it activate a monster, but when I pull it, it doesn't do anything.
Script:
void OnStart()
{
AddEntityCollideCallback("Player", "trap_1", "Jump1", true, 1);
}
void Jump1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("fail_1", true);
}
The Necromancer's Touch: WIP Coming March 2013
|
|
01-15-2013, 10:13 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Levers
You are doing it wrong:
Copy&paste this:
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetEntityActive("fail_1", true);
}
}
Hope it works!
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
01-15-2013, 10:17 PM |
|
assassinhawk45
Junior Member
Posts: 31
Threads: 11
Joined: Dec 2012
Reputation:
0
|
RE: Levers
Do I have to do anything for the lever? I put the script in and nothing happened. I'm guessing it migh thave to do with something in the level editor, but I'm not sure.
The Necromancer's Touch: WIP Coming March 2013
|
|
01-15-2013, 10:26 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Levers
Ofc, change the name of the lever to "lever". The problem must be the names.
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
01-15-2013, 10:28 PM |
|
assassinhawk45
Junior Member
Posts: 31
Threads: 11
Joined: Dec 2012
Reputation:
0
|
RE: Levers
Thanks, it's working now
The Necromancer's Touch: WIP Coming March 2013
|
|
01-15-2013, 10:34 PM |
|