local doors = { -- door position here
[{x = 0, y = 0, z = 0}] = 1,
[{x = 0, y = 0, z = 0}] = 2,
[{x = 0, y = 0, z = 0}] = 3,
[{x = 0, y = 0, z = 0}] = 4
}
local storage = 123456 -- vocation storage
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(storage) < 1 then
for position, vocation in pairs(doors) do
if isInArray(position, item:getPosition()) then
player:setVocation(vocation)
player:setStorageValue(storage, vocation)
return true
end
end
end
return true
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)@Omni Cloud where do i add that ;> ?
Is it teleportation door like click on it you pass to another side? or open and close door? but i think in your situation it will be teleportation door, so use it like thisokay and how to add it to actions xml ?
cause like doors i got fromid toid
<action actionid="ACTIONID" event="script" value="PLACEOFTHESCRIPT"/>
local doors = { -- door position here [{x = 0, y = 0, z = 0}] = 1, [{x = 0, y = 0, z = 0}] = 2, [{x = 0, y = 0, z = 0}] = 3, [{x = 0, y = 0, z = 0}] = 4 }
<action itemid="door item id" script="PLACEOFTHESCRIPT"/>