Hello guys. I want to make something like when player use stone coffin he will be teleported to x,y,z.
View attachment 47706
How should I do it? Please help.
data/actions/actions.xml<action actionid="45001" script="custom_actions/teleport_coffin.lua" />
data/actions/scripts/custom_actions/teleport_coffin.luafunction onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:teleportTo(Position(xxxxx, yyyyy, zzz))
return true
end
Hello guys. I want to make something like when player use stone coffin he will be teleported to x,y,z.
View attachment 47706
How should I do it? Please help.
data/actions/actions.xml<action actionid="45001" script="custom_actions/teleport_coffin.lua" />
data/actions/scripts/custom_actions/teleport_coffin.luafunction onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:teleportTo(Position(xxxxx, yyyyy, zzz))
return true
end
Add 45001 as an actionid onto the coffin. (or whatever number you don't have in use)
data/actions/actions.xml
XML:<action actionid="45001" script="custom_actions/teleport_coffin.lua" />data/actions/scripts/custom_actions/teleport_coffin.lua
LUA:function onUse(player, item, fromPosition, target, toPosition, isHotkey) creature:teleportTo(Position(xxxxx, yyyyy, zzz)) return true end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:teleportTo(Position(xxxxx, yyyyy, zzz))
return true
end
creature don't exist in scope rsAh oops. LolLUA:function onUse(player, item, fromPosition, target, toPosition, isHotkey) player:teleportTo(Position(xxxxx, yyyyy, zzz)) return true endcreaturedon't exist in scope rs