local STATS = {
dEAST = {
Uses = math.random(1, 210), -- per night
isActive = false,
Cooldown = 0.5,
},
dWEST = {
Uses = math.random(1, 210),
isActive = false,
Cooldown = 0.5,
},
lEAST = {
Uses = math.random(1, 210),
isActive = false,
Cooldown = 0.2,
},
lWEST = {
Uses = math.random(1, 210),
isActive = false,
Cooldown = 0.2,
},
Camera = {
Uses = math.random(1, 210),
isActive = false,
Cooldown = 0.2,
CUR_Viewng = "ShowStage", -- default
},
POWER = 100,
ACTIVE = nil,
TOTAL_POWER = nil,
}
-- FUNCTIONS
local function ConvertToArray(DIC) -- Converts a dictionary to an Array.
local ARRAY = {}
for i, v in next, DIC do
ARRAY[#ARRAY + 1] = v
end
return ARRAY
end
function Dump(o)
if type(o) == 'table' then
local s = '{\n'
for k, v in pairs(o) do
if type(k) ~= 'number' then k = '"' .. k .. '"' end
s = s .. '[' .. k .. '] = ' .. Dump(v) .. ',\n'
end
return s .. '},\n'
else
return tostring(o)
end
end
function dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
-- MATH LIBRARY (required)
local function GetPercentage(Value, Accuracy, DecimalPlacement) -- Converts a raw decimal value to a percent
if Accuracy then
return string.format("%." .. DecimalPlacement .. "f", Value * 100)
else
return math.floor((Value * 100) + 0.5)
end
end
print("Dictionary (Dump):\n" .. Dump(STATS))
print("\n")
print("Array (Dump):\n" .. Dump(ConvertToArray(STATS)))
To embed this project on your website, copy the following code and paste it into your website's HTML: