Frictional Games Forum (read-only)

Full Version: dont work Scripting a door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey im trying to scripting a door and my script looks like this !
Have i done something wrong beacuse when i use the key on the door i get a message
The Message goes like this : Cannot use this item this way!
If anyone have a clue please help me!



void OnStart()
{

AddUseItemCallback("", "Key1", "Door", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door", "Door", 0, false);
RemoveItem("Key1");

}


SPERMAHAREN Cool
I take it that the items inside your map are named "Key1" and "Door"?
(12-05-2011, 06:07 PM)i3670 Wrote: [ -> ]I take it that the items inside your map are named "Key1" and "Door"?
Name on Door : Door
CustomSubItemTypeName : Key1
(12-05-2011, 06:26 PM)Spermaharen Wrote: [ -> ]
(12-05-2011, 06:07 PM)i3670 Wrote: [ -> ]I take it that the items inside your map are named "Key1" and "Door"?
Name on Door : Door
CustomSubItemTypeName : Key1

there's your problem. You should type "Key1" in the name box.

(12-05-2011, 06:30 PM)i3670 Wrote: [ -> ]Name on Door : DoorCustomSubItemTypeName : Key1
(12-05-2011, 06:26 PM)Spermaharen Wrote: [ -> ]there's your problem. You should type "Key1" in the name box.
OMFG That was lame by me
Thank you so much it helps alot !