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

Lua Help with script

paulvzla

New Member
Joined
Jun 20, 2015
Messages
16
Reaction score
2
Hello people im trying to get this script working basically its an X item used on another X item then the player gets teleported

Lua:
local piedra= Action()


function piedra.onUse(player, item, fromPosition, target, toPosition, isHotkey)
        if item.itemid == 7761 then
        if target.itemid == 7518 then
            player:teleportTo({x = 32423, y = 32448, z = 7})
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            return true
        end
        end
    end


piedra:id(7761)
piedra:register()
 

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,244
Solutions
71
Reaction score
546
Location
Hell
Hello people im trying to get this script working basically its an X item used on another X item then the player gets teleported

Lua:
local piedra= Action()


function piedra.onUse(player, item, fromPosition, target, toPosition, isHotkey)
        if item.itemid == 7761 then
        if target.itemid == 7518 then
            player:teleportTo({x = 32423, y = 32448, z = 7})
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            return true
        end
        end
    end


piedra:id(7761)
piedra:register()

o.0
Lua:
local piedra = Action()
function piedra.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target:getId() == 7518 then
        player:teleportTo(Position(32423, 32448, 7))
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    end
    return true
end
piedra:id(7761)
piedra:register()
 
OP
paulvzla

paulvzla

New Member
Joined
Jun 20, 2015
Messages
16
Reaction score
2
o.0
Lua:
local piedra = Action()
function piedra.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target:getId() == 7518 then
        player:teleportTo(Position(32423, 32448, 7))
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    end
    return true
end
piedra:id(7761)
piedra:register()
test, but not working :l
 
OP
paulvzla

paulvzla

New Member
Joined
Jun 20, 2015
Messages
16
Reaction score
2
Make sure you have this script located in the folder data/scripts/
and ofc use the correct object over the correct object
1619286413155.png
this pops up when i run the server you think maybe is the item ID? , and yes im using the correct id with the correct object also the script is located in data/scripts
 
Top