• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Action] - [Movement] WalkOn certain Tile and needs a item to get teleported

pippo

New Member
Joined
May 3, 2011
Messages
46
Reaction score
0
I need a action or movement script ' You need to have a' item in your backpack example ''christmas token'' ID: 6527 when you StepOn on the tile you get a message orange message appeared "You have the correct item, You can passthrough now" If someone can make me this script I really appreciate it :) TFS version 0.4
 
XML:
	<movevent type="StepIn" uniqueid="xxxx" event="script" value="scriptname.lua"/>
data/movements/scriptname.lua
LUA:
function onStepIn(cid, item, position, fromPosition)

local position = {x= xxx, y= yyy, z= z}
if getPlayerItemCount(cid, 6527, 1) then
	doTeleportThing(cid, position)
	doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
end
return true
end
 
XML:
	<movevent type="StepIn" uniqueid="xxxx" event="script" value="scriptname.lua"/>
data/movements/scriptname.lua
LUA:
function onStepIn(cid, item, position, fromPosition)

local position = {x= xxx, y= yyy, z= z}
if getPlayerItemCount(cid, 6527, 1) then
	doTeleportThing(cid, position)
	doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
end
return true
end

You don't need to teleport the player if he have the item, he just step and go on, but if he doesn't have the item, then he got teleported!

LUA:
function onStepIn(cid, item, position, fromPosition)
 
local position = {x = position.x, y = position.y+1, z = position.z} -- Teleport South
    if getPlayerItemCount(cid, 6527, 1) then
        doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
    else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
        doTeleportThing(cid, position)
    end

    return true
end
 
I didn't know he wanted this i thought he want to teleport the player somewhere.
anyway if he mean to teleport player back then it can be done this way more flixable.
LUA:
function onStepIn(cid, item, position, fromPosition)
 
    if getPlayerItemCount(cid, 6527, 1) then
        doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
    else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
		doTeleportThing(cid, fromPosition, TRUE)
    end
 
    return true
end
 
I didn't know he wanted this i thought he want to teleport the player somewhere.
anyway if he mean to teleport player back then it can be done this way more flixable.
LUA:
function onStepIn(cid, item, position, fromPosition)
 
    if getPlayerItemCount(cid, 6527, 1) then
        doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
    else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
		doTeleportThing(cid, fromPosition, TRUE)
    end
 
    return true
end
When i use your edited script it doesn't teleport me anymore to the location it just gives me an message that i dont have the item "I need it to remove from my backpack the item and let me teleport to the location and and if i dont have the item "it will say you dont have the item with you, and than it push me 1 square back from the tile"

- - - Updated - - -

need something like DoPlayerRemoveItem in the script so they wont be able to use the same item over and over again :)
 
Here should work
LUA:
function onStepIn(cid, item, position, fromPosition)
 
local position = {x= xxx, y= yyy, z= z}--Edite This to where player get teleproted
if getPlayerItemCount(cid, 6527, 1) then
	doTeleportThing(cid, position)
	doPlayerRemoveItem(cid, 6527, 1)
	doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
end
return true
end
 
Here should work
LUA:
function onStepIn(cid, item, position, fromPosition)
 
local position = {x= xxx, y= yyy, z= z}--Edite This to where player get teleproted
if getPlayerItemCount(cid, 6527, 1) then
	doTeleportThing(cid, position)
	doPlayerRemoveItem(cid, 6527, 1)
	doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
end
return true
end
Still not good It removes the token but i can still teleport with the tile without a token :c
 
try
LUA:
function onStepIn(cid, item, position, fromPosition)
 
local position = {x= xxx, y= yyy, z= z}--Edite This to where player get teleproted
if doPlayerRemoveItem(cid, 6527, 1) then
	doTeleportThing(cid, position)
	doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
end
return true
end
 
try
LUA:
function onStepIn(cid, item, position, fromPosition)
 
local position = {x= xxx, y= yyy, z= z}--Edite This to where player get teleproted
if doPlayerRemoveItem(cid, 6527, 1) then
	doTeleportThing(cid, position)
	doPlayerSendTextMessage(cid, 19, "You have the correct item, You can passthrough now")
else
	doPlayerSendTextMessage(cid, 19, "You don't have the correct item to pass")
end
return true
end

Thanks this one is good thanks in advance Rep++
 
Back
Top