Help with this script, I want the domains to open the portals with the lever. The error is that all players can open without having the domain please...
local gatepos = {x=194, y=91, z=15, stackpos=1} --posição do primeiro portão
local g = 1544 --id do primeiro portão
local g2 = 1544 --id do segundo portão
local g3 = 1544 --id do terceiro portão
local doorOpen = "The door has been opened!"
local doorClose = "The door has been closed!"
local guildname = 1
function onUse(cid, item, frompos, item2, topos)
if getPlayerAccess(cid) >= guildname then
local item = getTileItemById(gatepos, g)
if item.uid > 0 then
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 22, doorOpen)
else
doCreateItem(g, 1, gatepos)
doPlayerSendTextMessage(cid, 22, doorClose)
end
end
return true
end
local gatepos = {x=194, y=91, z=15, stackpos=1} --posição do primeiro portão
local g = 1544 --id do primeiro portão
local g2 = 1544 --id do segundo portão
local g3 = 1544 --id do terceiro portão
local doorOpen = "The door has been opened!"
local doorClose = "The door has been closed!"
local guildname = 1
function onUse(cid, item, frompos, item2, topos)
if getPlayerAccess(cid) >= guildname then
local item = getTileItemById(gatepos, g)
if item.uid > 0 then
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 22, doorOpen)
else
doCreateItem(g, 1, gatepos)
doPlayerSendTextMessage(cid, 22, doorClose)
end
end
return true
end