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

TFS 0.X 0.3.7 if use shovel > TP playerpos z-1

OTcreator

Active Member
Joined
Feb 14, 2022
Messages
428
Solutions
1
Reaction score
44
Hello,
I need script, when I use item (etc. shovel with target) on item.uid XXXX, player teleport to position z - 1.
Please help me.
 
Solution
Shovel is already in use, so you'd have to add this into the shovel script, or choose another item

depending on your version of 0.3.7.. you might need to change .aid to .actionid
So if you get some errors, that's what you'll want to change.

XML:
<action itemid="11111" event="script" value="teleportItem.lua"/>
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.aid == XXXX then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y, z = toPosition.z + 1})
    end
    return true
end

-- if adding to original shovel, put this
Lua:
    if itemEx.aid == XXXX then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y, z = toPosition.z + 1})
        return true
    end
Shovel is already in use, so you'd have to add this into the shovel script, or choose another item

depending on your version of 0.3.7.. you might need to change .aid to .actionid
So if you get some errors, that's what you'll want to change.

XML:
<action itemid="11111" event="script" value="teleportItem.lua"/>
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.aid == XXXX then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y, z = toPosition.z + 1})
    end
    return true
end

-- if adding to original shovel, put this
Lua:
    if itemEx.aid == XXXX then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y, z = toPosition.z + 1})
        return true
    end
 
Solution
Shovel is already in use, so you'd have to add this into the shovel script, or choose another item

depending on your version of 0.3.7.. you might need to change .aid to .actionid
So if you get some errors, that's what you'll want to change.

XML:
<action itemid="11111" event="script" value="teleportItem.lua"/>
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.aid == XXXX then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y, z = toPosition.z + 1})
    end
    return true
end

-- if adding to original shovel, put this
Lua:
    if itemEx.aid == XXXX then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y, z = toPosition.z + 1})
        return true
    end
Thank you! Work perfect with shovel script!
 
Back
Top