• 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!

Tile can't walk with itens

dynkzin

New Member
Joined
Feb 5, 2022
Messages
5
Reaction score
0
GitHub
douglas12
Hello, can anyone help me , i need a script who makes ID : tile not walkeable if have itens/set/bp...etc
 
Solution
X
8.6
tfs 0.4

The scripts above are for TFS 1.0+
This is why it's important to let us know your server version, or you'll get scripts that aren't helpful. xD

Try this instead
XML:
<movevent event="StepIn" itemid="111111111" script="scriptName.lua" />
LUA:
local teleportPosition = {x = 1000, y = 1000, z = 7} -- if they have items, teleport them here

function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then
        doTeleportThing(cid, teleportPosition)
        return true
    end
    local slotItem
    for i = 1, 10 do
        slotItem = getPlayerSlotItem(cid, i)
        if slotItem.itemid > 0 then
            doTeleportThing(cid, teleportPosition)
            return true
        end
    end
    return...
Items, with an M. I don't understand this phenomenon.

Also, can you be more specific about what you're trying to achieve? Have you tried anything?

A tile you can't walk on if you're holding a specific item?
 
Hello, can anyone help me , i need a script who makes ID : tile not walkeable if have itens/set/bp...etc
Good question.
To try to look for answers for you I tried creating a script for tileid 407 (found in TFS temple) just to test and the script doesn't even execute.
Looks like it only executes for non-ground items such as chests.
Hopefully someone more experienced with TFS has an answer for you.
 
This a video
with items you can't walk
comitem.gif


without items you can

asdasd.gif

 
LUA:
local tileId = 11111111 -- itemId they are stepping on
local teleportPosition = Position(1000, 1000, 7) -- if they have items, teleport them here

local moveEvent = MoveEvent()
moveEvent:type("stepin")

function moveEvent.onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        creature:teleportTo(teleportPosition)
        return true
    end
    local slotItem
    for i = 1, 10 do
        slotItem = player:getSlotItem(i)
        if slotItem then
            creature:teleportTo(teleportPosition)
            return true
        end
    end
    return true
end

moveEvent:id(tileId)
moveEvent:register()
 
LUA:
local tileId = 11111111 -- itemId they are stepping on
local teleportPosition = Position(1000, 1000, 7) -- if they have items, teleport them here

local moveEvent = MoveEvent()
moveEvent:type("stepin")

function moveEvent.onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        creature:teleportTo(teleportPosition)
        return true
    end
    local slotItem
    for i = 1, 10 do
        slotItem = player:getSlotItem(i)
        if slotItem then
            creature:teleportTo(teleportPosition)
            return true
        end
    end
    return true
end

moveEvent:id(tileId)
moveEvent:register()
can you tell me what i put in movements.xml?
 
can you tell me what i put in movements.xml?
The script above is for rev scripts. You just put it into data/scripts as a lua file.

If for some reason you don't have rev scripts.. then yeah just throw it into movements

XML:
<movevent event="StepIn" itemid="111111111" script="scriptName.lua" />
LUA:
local teleportPosition = Position(1000, 1000, 7) -- if they have items, teleport them here

function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        creature:teleportTo(teleportPosition)
        return true
    end
    local slotItem
    for i = 1, 10 do
        slotItem = player:getSlotItem(i)
        if slotItem then
            creature:teleportTo(teleportPosition)
            return true
        end
    end
    return true
end
 
The script above is for rev scripts. You just put it into data/scripts as a lua file.

If for some reason you don't have rev scripts.. then yeah just throw it into movements

XML:
<movevent event="StepIn" itemid="111111111" script="scriptName.lua" />
LUA:
local teleportPosition = Position(1000, 1000, 7) -- if they have items, teleport them here

function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        creature:teleportTo(teleportPosition)
        return true
    end
    local slotItem
    for i = 1, 10 do
        slotItem = player:getSlotItem(i)
        if slotItem then
            creature:teleportTo(teleportPosition)
            return true
        end
    end
    return true
end
i have this issue
1644250198763.png
 
8.6
tfs 0.4

The scripts above are for TFS 1.0+
This is why it's important to let us know your server version, or you'll get scripts that aren't helpful. xD

Try this instead
XML:
<movevent event="StepIn" itemid="111111111" script="scriptName.lua" />
LUA:
local teleportPosition = {x = 1000, y = 1000, z = 7} -- if they have items, teleport them here

function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then
        doTeleportThing(cid, teleportPosition)
        return true
    end
    local slotItem
    for i = 1, 10 do
        slotItem = getPlayerSlotItem(cid, i)
        if slotItem.itemid > 0 then
            doTeleportThing(cid, teleportPosition)
            return true
        end
    end
    return true
end
 
Solution
Back
Top