![]() |
2 keys script - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: 2 keys script (/thread-11719.html) |
2 keys script - Kainzor - 12-06-2011 hey im havin some problem with doin 2 keys script i know im doin somthing wrong but this is the first key script that worked fine --------- void OnStart() { AddUseItemCallback("", "bedroomkey_1", "mansion_1", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false); RemoveItem("bedroomkey_1"); ------ but where do i put the 2nd key script and how do i script it..... any info can help me thank you for reading this RE: 2 keys script - flamez3 - 12-06-2011 Im assuming that you want 2 keys to make a door unlocked? If so: PHP Code: void OnStart() If you need me to explain what that script is and why it works just ask ^^ RE: 2 keys script - Kainzor - 12-06-2011 no i mean....not same door.... how do you script with 1 key ea door by havin 2 keys like.... i got mansion_1 and mansion_2, i got key_1 and key_2, i know how to script the first key but there's always and error whn i do the 2nd 1 ..... i know my scripting must be wrong but i cant find it.... so i deleted it and tried have help on this website RE: 2 keys script - flamez3 - 12-06-2011 (12-06-2011, 04:33 PM)Kainzor Wrote: no i mean....not same door.... how do you script with 1 key ea door by havin 2 keys like.... i got mansion_1 and mansion_2, i got key_1 and key_2, i know how to script the first key but there's always and error whn i do the 2nd 1 ..... i know my scripting must be wrong but i cant find it.... so i deleted it and tried have help on this websiteOkay do this: PHP Code: void OnStart() Also rename the doors and keys to the right names. And you can always post your script int the forums to get some insight on how to correct the problem. :3 RE: 2 keys script - Kainzor - 12-06-2011 alright that worked thanks alot ![]() RE: 2 keys script - Your Computer - 12-06-2011 It'd be more efficient if you had one function deal with all swing doors: PHP Code: void OnStart() RE: 2 keys script - flamez3 - 12-06-2011 (12-06-2011, 05:24 PM)Your Computer Wrote: It'd be more efficient if you had one function deal with all swing doors:Wow, didn't know about that, thanks. RE: 2 keys script - Dobbydoo - 12-07-2011 (12-06-2011, 05:24 PM)Your Computer Wrote: It'd be more efficient if you had one function deal with all swing doors:But wouldn't that just make both doors unlock when using one key? :S RE: 2 keys script - flamez3 - 12-07-2011 (12-07-2011, 03:23 PM)Dobbydoo Wrote:The asEntity makes it so whichever entity it's linked in the void OnStart block will be the one being unlocked.(12-06-2011, 05:24 PM)Your Computer Wrote: It'd be more efficient if you had one function deal with all swing doors:But wouldn't that just make both doors unlock when using one key? :S RE: 2 keys script - Dobbydoo - 12-07-2011 (12-07-2011, 03:25 PM)flamez3 Wrote:Oh, of course! Stupid me *facepalm*(12-07-2011, 03:23 PM)Dobbydoo Wrote:The asEntity makes it so whichever entity it's linked in the void OnStart block will be the one being unlocked.(12-06-2011, 05:24 PM)Your Computer Wrote: It'd be more efficient if you had one function deal with all swing doors:But wouldn't that just make both doors unlock when using one key? :S |