
The script
Code: Select all
local myGlobalData = Data(Data.DATA_WORLD, "switchPalace")
if myGlobalData == nil then
myGlobalData:set("exampleGlobalSwitch", tostring(1))
myGlobalData:save()
end
function onEvent(eventname)
if eventname == "globalBarrierKill" then
myGlobalData:set("exampleGlobalSwitch", tostring(0))
myGlobalData:save()
end
end
local ranInitialCheck = false;
local barrierData = myGlobalData:get("exampleGlobalSwitch");
function onLoop()
if ranInitialCheck == false then
if barrierData = tostring(0) then
triggerEvent("globalBarrierKill")
end
ranInitialCheck = true;
end
end