ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
Here is my code
So when I "use" the mwall it gives me the else reading "you dont have the key" but when I use the key on the mwall, it says "sorry not possible" at the bottom and does nothing, whats wrong with this code? The UID's and such are set right thats not the problem.
LUA:
local pos = {x=419, y=1325, z=8}
local mwall = 1497
local key = 2087
function onUse(cid, item, frompos, item2, topos)
if getPlayerItemCount(cid, key) >= 1 and
(item.itemid == key) and
(itemEx.itemid == mwall) then
doRemoveItem(pos, mwall)
doCreatureSay(cid, "Opened the door.", TALKTYPE_ORANGE_1)
addEvent(respawn, 3000)
else
doCreatureSay(cid, "You do not have the right key for this door.", TALKTYPE_ORANGE_1)
end
return true
end
function respawn(cid)
doCreateItem(mwall, pos)
end
So when I "use" the mwall it gives me the else reading "you dont have the key" but when I use the key on the mwall, it says "sorry not possible" at the bottom and does nothing, whats wrong with this code? The UID's and such are set right thats not the problem.