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
Level Editor Help Locked door
nathanmcb Offline
Junior Member

Posts: 18
Threads: 6
Joined: Jun 2012
Reputation: 0
#1
Locked door

Can you help me with the script for the key and a locked door.
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "HU2key_1", "HUdoor", "UsedKeyOnDoor", true);
}

void UsedHU2key_1(string &in asItem, string &in asEntity)

{
SetSwingDoorLocked("HUdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "HUdoor", 0, false);
RemoveItem("HU2key_1");

That is the script. What am I doing wrong? Sad
06-17-2012, 04:36 AM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Locked door

You have the UseItemCallback calling the function "UsedKeyOnDoor", while your unlock function is "UsedHu2key_1"
Oh, and you're missing an end brace after the UsedHU2key_1 function.

06-17-2012, 04:38 AM
Find
nathanmcb Offline
Junior Member

Posts: 18
Threads: 6
Joined: Jun 2012
Reputation: 0
#3
RE: Locked door

Thank you.... I love you haha Big Grin

(06-17-2012, 04:38 AM)Obliviator27 Wrote: You have the UseItemCallback calling the function "UsedKeyOnDoor", while your unlock function is "UsedHu2key_1"
Oh, and you're missing an end brace after the UsedHU2key_1 function.
Thank you so much!
I'm so happy I could just scream!...... yey :3
(This post was last modified: 06-17-2012, 04:55 AM by nathanmcb.)
06-17-2012, 04:53 AM
Find




Users browsing this thread: 1 Guest(s)