Sirdonald
Member
- Joined
- Jan 16, 2012
- Messages
- 119
- Reaction score
- 11
Hi, I have a script to remove a wall using a lever. Unfortunately it does not work pops up such error in the console
Lua:
local event = 0
local wall = 9532 -- id sciany ktora ma sie pojawic
local level = 1
local pos = {x=846, y=849, z=7, 9533} -- position sciany
local function reset(leverPos)
local lever = getTileItemById(leverPos, 1946).uid
doTransformItem(lever, 1945)
doCreateItem(wall, 1, pos)
doBroadcastMessage(getCreatureName(cid) .. " Zamknal brame na Serek Event!")
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 and getPlayerLevel(cid) >= level and os.time() > getPlayerStorageValue(cid, exhausted_storagevalue) then
doRemoveItem(getTileItemById(pos,wall).uid)
doBroadcastMessage(getCreatureName(cid) .. " zaprasza na Serek Event!")
event = addEvent(reset, seconds * 1000, getThingPos(item.uid))
doTransformItem(item.uid,item.itemid+1)
elseif item.itemid == 1946 and getPlayerLevel(cid) >= level then
stopEvent(event)
doBroadcastMessage(getCreatureName(cid) .. " Zamknal brame na Serek Event!")
doTransformItem(item.uid,item.itemid-1)
doCreateItem(wall, 1, pos)
end
return true
end
Attachments
-
Bez tytułu.png24.2 KB · Views: 18 · VirusTotal
Last edited: