The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
about scripting
mccrazy5 Offline
Junior Member

Posts: 11
Threads: 4
Joined: Jun 2012
Reputation: 0
#1
Rainbow  about scripting

Hello guys , i am trying to script a key to open a door.
I have looked for some tutorials and i found some.
But when i tried them, It didnt work for me.
This is what i did:
I have made a small room with a door and a key .
I have locked the door and named it "mansion_1".
I made a key and on name i called it "key_1" and in the entity i have called it "key1"
After that i have created this script.
And when i run this on game, the game crash.
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key1", "mansion_1", "KeyOnDoor", true);
}

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

{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", mansion_1, 0, false);
RemoveItem(asItem);
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Any idea why its not working ?
06-09-2012, 05:56 PM
Find


Messages In This Thread
about scripting - by mccrazy5 - 06-09-2012, 05:56 PM
RE: about scripting - by Putmalk - 06-09-2012, 06:05 PM
RE: about scripting - by mccrazy5 - 06-09-2012, 06:36 PM
RE: about scripting - by Science - 06-09-2012, 06:44 PM
RE: about scripting - by Putmalk - 06-09-2012, 06:54 PM
RE: about scripting - by mccrazy5 - 06-09-2012, 07:12 PM



Users browsing this thread: 1 Guest(s)