if getPlayerSlotItem(cid,CONST_SLOT_HEAD).uid > 0 then ---This to check if there is an item there
if getPlayerSlotItem(cid,CONST_SLOT_HEAD).itemid == 2256 then -- This to check if the item in head slot is math with that itemid
local pos = -- the checked postion for the thing
--If i used <<getThingFromPos>>
local get = getThingFromPos(pos)
-- now to check for the uid if exist[the item/or creature there]
if get.uid > 0 then -- so this line checks if there is somthng there else we should use <0 to check if there isnt a thing there
--further more after we checked if there is a thing there we need to specify so use
if get.itemid == 1387
doRemoveItem(get.uid) --so this will remove the teleport
--check if isplayer there anyplayer not a definite one
if isPlayer(get.uid) then
if getPlayerSlotItem(cid,CONST_SLOT_HEAD).itemid == 0 then
function onUse (cid, item, frompos, topos)
if getPlayerSlotItem(cid,CONST_SLOT_HEAD).itemid == 0 then
doPlayerGiveItem (cid,2457,1,CONST_SLOT_HEAD,1)
end
end
function onUse (cid, item, frompos, topos)
if getPlayerSlotItem(cid,CONST_SLOT_HEAD).uid == 0 then
if doPlayerTakeItem(cid,2457,1,CONST_SLOT_BACKPACK,1) == true
then doPlayerGiveItem(cid,2457,1,CONST_SLOT_HEAD,1)
return true
end
else
if getPlayerSlotItem(cid,CONST_SLOT_HEAD).itemid == 2457 then
doPlayerSendCancel(cid, "You already have a steel helmet equipted.")
return false
end
end
end