Key Lock Puzzle maybe
Posted: Fri Nov 07, 2014 4:13 am
Hi guys I originally got this code from DesperateGames and now I got it to work. Ok here is what you need for 2 Locks:
1 x door: mine is. dungeon_door_wooden_9
1 x counter called: unlockCounter2
Value = 0
1 x Script Entity called: What ever you like.
2 x Locks: (on the wall) or more see (below)
opened by 2 different Keys eg: brass and silver.
Connect the 2 Locks to: function addUnlock1()
When the 2 keys are placed into the locks the door will open. Also I have added at the end of the code away to use extra locks.
Anyway it is simple for the coders, but for me well.....it works that's what matters
Any how's if there are problems call me.
1 x door: mine is. dungeon_door_wooden_9
1 x counter called: unlockCounter2
Value = 0
1 x Script Entity called: What ever you like.
2 x Locks: (on the wall) or more see (below)
opened by 2 different Keys eg: brass and silver.
Connect the 2 Locks to: function addUnlock1()
When the 2 keys are placed into the locks the door will open. Also I have added at the end of the code away to use extra locks.
Code: Select all
unlockCounter2 = 0
function addUnlock1() ---Connect both locks to this function yeah---
playSound("secret")
unlockCounter2 = unlockCounter2 + 1
if unlockCounter2 ==1 then
hudPrint("First lock unlocked.")
elseif unlockCounter2==2 then
hudPrint("Second lock unlocked.")
dungeon_door_wooden_9.door:open()
party.party:getChampion(1,4):gainExp(50)
hudPrint("DRACO: Well what can I say")
hudPrint("")
hudPrint("Gained 50 Xp")
end
end
--- If you want to add more locks with more Keys---
--- Third Lock: I have just added more code ---
unlockCounter2 = 0
function addUnlock1()
playSound("secret")
unlockCounter2 = unlockCounter2 + 1
if unlockCounter2 ==1 then
hudPrint("First lock unlocked.")
elseif unlockCounter2==2 then
hudPrint("Second lock unlocked.")
elseif unlockCounter2==3 then ---added extra code here---
hudPrint("Third lock unlocked.")
---add another lock here if you wish eg:
--if unlockCounter2 ==4 then
--hudPrint("Forth lock unlocked.")
dungeon_door_wooden_9.door:open()
party.party:getChampion(1,4):gainExp(50)
hudPrint("DRACO: Well what can I say")
hudPrint("")
hudPrint("Party Gained 50 Xp")
end
end
