Scripts / Question about open a door requiring three keys not in any order?

Author
Message
Freakon
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: UK
Posted: 30th Aug 2016 14:25
Hi all! I'm currently using this script (keymulti3) with the (doorkeymulti3) all working and all in order. But how would I get the door to need 3 keys not in any order, but named different? key1 /key2 / key3 for example?



can I just add doorkey1 doorkey2 doorkey3 in to "doorkey ==3 then" and if so how do I break the line? as in does it require commas between each name?

Any help would be great! Thanks in advance
http://steamsignature.com/profile/english/76561197972451884.png
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 30th Aug 2016 15:46
I don't own that script (though), anyway basically you has to increase a global var by one, each time you get a key (in your case "doorkey " var)

Place a keys in a map.
Attach the script to each one (those than increase var, usually "key.lua" with a bit modification, to suit yours needs)

Rename script IE: "multikey.lua"
Rename also the functions (_init and _main) in the script.

Where "key.lua" say:



And attach your script to the door, it should work.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 31st Aug 2016 02:30 Edited at: 31st Aug 2016 02:32
I can give you an example to get you going. here is the key script I would use.



All I did was add A variable to the key script that will add 1 to the g_key_count variable that way you can collect keys. The next thing you would need to do is get a door script the one that is in the script bank will work and add an if statement like if g_key_count == how ever many keys then open when e is pressed. If you need further help I would be glad to help!
Markchapman10 is my Skype let's have some dev talk.
Freakon
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: UK
Posted: 31st Aug 2016 13:18
Thanks for you help guys! both of the scripts work fine, in terms of offering a need for more than 1 key! +1 var was what i was missing!

Login to post a reply

Server time is: 2024-12-22 22:24:18
Your offset time is: 2024-12-22 22:24:18