function onStepIn(cid, item, position, fromPosition)
local toPositionz = {x=x, y=y, z=z}
if item.actionid == 15318 then
if getPlayerItemCount(cid, 2341) >= 1 and getPlayerStorageValue(cid, 5031) == -1 then
doTeleportThing(cid, toPositionz)
setPlayerStorageValue(cid, 5031, 1)
else
doTeleportThing(cid, fromPosition)
end
end
end
local config = {
destination = {x = 100, y = 100, z = 7},
storage = 12345
}
function onStepIn(cid, item, position, fromPosition)
local v = getPlayerStorageValue(cid, config.storage) > 0 and config.destination or fromPosition
return doTeleportThing(cid, v) and doSendMagicEffect(v, CONST_ME_TELEPORT)
end
function onUse(cid, item, frompos, item2, topos)
local newposition = {x=, y=, z=}
if item.uid == 11111 then
queststatus = getPlayerStorageValue(cid,1111)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"Congratulations, You have found 100 Cystal Coins and being teleported somewhere!")
doPlayerAddItem(cid,2160,100)
doTeleportThing(cid, newposition)
doSendMagicEffect(newposition, 10)
setPlayerStorageValue(cid,11111,1)
else
doPlayerSendTextMessage(cid,22,"It's empty!")
end
else
return 0
end
return 1
end
Edit: And is possible tp when wear or have X outfit you can use tp?
function onStepIn(cid, item, position, fromPosition)
local outfit = {lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}
if getCreatureOutfit(cid) == outfit then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome.")
else
doTeleportThing(cid, fromPosition, true)
doPlayerSendCancel(cid, "You must be wearing lookType " .. outfit.lookType .. ".")
end
return true
end
Code:function onStepIn(cid, item, position, fromPosition) local outfit = {lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0} if getCreatureOutfit(cid) == outfit then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome.") else doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "You must be wearing lookType " .. outfit.lookType .. ".") end return true end
function compareOutfits(o1, o2)
return (o1.lookType == o2.lookType and o1.lookHead == o2.lookHead and o1.lookAddons == o2.lookAddons and o1.lookLegs == o2.lookLegs and o1.lookBody == o2.lookBody and o1.lookFeet == o2.lookFeet)
end
function onStepIn(cid, item, position, fromPosition)
local outfit = {lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}
if compareOutfits(getCreatureOutfit(cid), outfit) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome.")
else
doTeleportThing(cid, fromPosition, true)
doPlayerSendCancel(cid, "You must be wearing lookType " .. outfit.lookType .. ".")
end
return true
end
error, you cant compare tables 8)
LUA:function compareOutfits(o1, o2) return (o1.lookType == o2.lookType and o1.lookHead == o2.lookHead and o1.lookAddons == o2.lookAddons and o1.lookLegs == o2.lookLegs and o1.lookBody == o2.lookBody and o1.lookFeet == o2.lookFeet) end function onStepIn(cid, item, position, fromPosition) local outfit = {lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0} if compareOutfits(getCreatureOutfit(cid), outfit) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome.") else doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "You must be wearing lookType " .. outfit.lookType .. ".") end return true end
if compareOutfits(getCreatureOutfit(cid), outfit) then
if compareOutfits(getCreatureOutfit(cid, outfit)) then
Maybe, but
=Code:if compareOutfits(getCreatureOutfit(cid), outfit) then
Code:if compareOutfits(getCreatureOutfit(cid, outfit)) then