kimokimo
Kimo
as the title say when the player step on a tile if he have itemid,count get teleported to x,x,x if he dont then teleport to x,x,x
function onStepIn(cid, item, pos, fromPos)
if isPlayer(cid) then
local p
if getPlayerItemCount(cid, itemid) == 0 then
p = {x=100, y=100, z=7} -- no item
else
p = {x=100, y=100, z=7}
end
doTeleportThing(cid, p)
doSendMagicEffect(pos, CONST_ME_POFF)
doSendMagicEffect(p, CONST_ME_TELEPORT)
end
end
function onStepIn(cid, item, pos, fromPos)
if isPlayer(cid) then
local p
if doPlayerRemoveItem(cid, itemid) == 0 then
p = {x=100, y=100, z=7} -- no item
else
p = {x=100, y=100, z=7}
end
doTeleportThing(cid, p)
doSendMagicEffect(pos, CONST_ME_POFF)
doSendMagicEffect(p, CONST_ME_TELEPORT)
end
end
function onStepIn(cid, item, pos, fromPos)
if isPlayer(cid) then
local items = {
Amount = 1,
Name = "Spike Sword",
ID = 1337
}
local t = {
pos = {z=1000, y=1000, z=7}, -- Position if have the items
npos = {z=1000, y=1000, z=7} -- Position if dont have the items
}
-- SCRIPT START
if getPlayerItemCount(cid, items.ID) >= items.Amount then
doPlayerRemoveItem(cid, items.ID, items.Amount)
doTeleportThing(cid, t.pos)
else
doTeleportThing(cid, npos)
doPlayerSendTextMessage(cid, 25, "Sorry, but you need ".. items.Amount .." ".. items.Name .." to use this portal.")
end
end
return true
end
local itemid,count = 1025,1 -- first is itemid of item to be removed, second is count of the item.
function onStepIn(cid, item, pos, fromPos)
if isPlayer(cid) then
local p
if doPlayerRemoveItem(cid, itemid, count) then
p = {x=100, y=100, z=7} -- has item
else
p = {x=100, y=100, z=7} -- no item
end
doTeleportThing(cid, p)
doSendMagicEffect(pos, CONST_ME_POFF)
doSendMagicEffect(p, CONST_ME_TELEPORT)
end
end