This script should summon a demon from a lamp, 3 times then run out of charges but it won't work.
heres my code:
local config=
{
monster="Demon"
i=3
}
function onUse(cid, item, frompos, itemEx, topos)
if config.i >0 then
if item.itemid == 2063 then
doSummonCreature(config.demon, getCreaturePosition(cid))
config.i-1
doPlayerSendTextMessage(cid,21,"It works !")
else
doPlayerSendTextMessage(cid, 21, "It still doesn't work!")
end
else
doPlayerSendTextMessage(cid, 21, "Your item has ran out of charges")
end
return TRUE
end
thanks
heres my code:
local config=
{
monster="Demon"
i=3
}
function onUse(cid, item, frompos, itemEx, topos)
if config.i >0 then
if item.itemid == 2063 then
doSummonCreature(config.demon, getCreaturePosition(cid))
config.i-1
doPlayerSendTextMessage(cid,21,"It works !")
else
doPlayerSendTextMessage(cid, 21, "It still doesn't work!")
end
else
doPlayerSendTextMessage(cid, 21, "Your item has ran out of charges")
end
return TRUE
end
thanks