Hi,
How I do to add the message in this script? When the player use the lever, he receives a message in the default.
Thanks.
How I do to add the message in this script? When the player use the lever, he receives a message in the default.
PHP:
local config ={
pos = {x=808, y=1151, z=8},
itemid = 1304,
time = 1800
}
local function Remove(fromPosition)
doCreateItem(config.itemid, 1, config.pos)
doTransformItem(getTileItemById(fromPosition, 1946).uid, 1945)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
doRemoveItem(getTileItemById(config.pos, config.itemid).uid)
addEvent(Remove, config.time * 1000, fromPosition)
doTransformItem(item.uid, 1946)
elseif item.itemid == 1946 then
if getTileItemById(config.pos, config.itemid).uid > 0 then
doTransformItem(item.uid, 1945)
else
doPlayerSendCancel(cid, "It seems the lever has been already used.")
end
end
return true
end
Thanks.