Files
volcano/settings.lua
T
2026-02-08 10:57:49 +02:00

34 lines
929 B
Lua

-- We define the local variable for our settings table here so that our functions can see it
local settings
function script:init()
settings = Util.optStorage(TheoTown.getStorage(), 'volcano_plugin:settings')
-- Check if the the key is not set in the storage
if settings.autoDisaster == nil then
settings.autoDisaster = false
end
if settings.autoDisaster then
TheoTown.setGlobalFunVar("!_autovolcanodisasterjajaja", 1)
else
TheoTown.setGlobalFunVar("!_autovolcanodisasterjajaja", 0)
end
end
function script:settings()
return {
{
name = 'Spawn Volcano Disaster',
value = settings.autoDisaster,
onChange = function(newState)
settings.autoDisaster = newState
if newState then
TheoTown.setGlobalFunVar("!_autovolcanodisasterjajaja", 1)
else
TheoTown.setGlobalFunVar("!_autovolcanodisasterjajaja", 0)
end
end
},
}
end