function doSomething(you, fill, this, out, yourself)
[COLOR="#FF0000"] if(getPlayerItemCount(cid, itemId) < 1) then
doPlayerAddItem(cid, itemId, count)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end[/COLOR]
return true
end
function onThink(cid, interval)
if getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == 0 and getPlayerItemCount(cid, 2395) == 0 then
doPlayerAddItem(cid, 2395, 1)
end
return true
end
<event type="think" name="legs" event="script" value="legs.lua"/>
here is it ... put it in creaturescripts
Code:function onThink(cid, interval) if getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == 0 and getPlayerItemCount(cid, 2395) == 0 then doPlayerAddItem(cid, 2395, 1) end return true end
add this line to creaturescripts.xml
Code:<event type="think" name="legs" event="script" value="legs.lua"/>
register it into login.lua too
That's not a creature script. It's a global event, and also a bad idea. ^_^