Ozo
New Member
- Joined
- Jun 30, 2008
- Messages
- 58
- Reaction score
- 0
Hello!
Scenario:
Player stands at a specific tile -> pulls lever -> gets teleported
How would i modify this script to check if a player stands at the correct position
instead of an item/corpse?
Lua:
Thanks in advance!
Scenario:
Player stands at a specific tile -> pulls lever -> gets teleported
How would i modify this script to check if a player stands at the correct position
instead of an item/corpse?
Lua:
Code:
function onUse(cid, item, frompos, item2, topos)
playerpos = getPlayerPosition(cid)
nplayer1pos = {x= , y= , z= } --Put here the New position
corpsepos = {x= , y= , z= , stackpos=1} --And here the Corpse position
corpse = getThingfromPos(corpsepos)
if item.itemid == 1945 then
if corpse.itemid = corpseID then --Change corpseID for the ID of the corpse
doTransformItem(item.uid,item.itemid+1)
doRemoveItem(corpse.uid, 1)
doSendMagicEffect(topos, 36)
doSendMagicEffect(playerpos,2)
doTeleportThing(cid,nplayer1pos)
doSendMagicEffect(nplayer1pos,10)
doSendAnimatedText(nplayer1pos, "Teleport!", TEXTCOLOR_RED)
else
doPlayerSendTextMessage(cid, 22, "Put the corpse on coal basin.")
end
elseif item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
doSendMagicEffect(topos, 2)
end
return 1
end