Protect your script

Runtime variables

Globals the whitelist sets before your code runs — premium status, time left, Discord ID and more.

On this page

Available variables

After a successful activation — and before the first line of your code — the whitelist writes these into your script's environment:

VariableTypeValue
SA_IsUserPremiumbooleanThe key is Premium.
SA_LinkedDiscordIDstringLinked Discord ID, "" if none.
SA_ScriptNamestringThe name of the obfuscated script.
SA_TotalExecutionsnumberHow many times this key has loaded the script.
SA_SecondsLeftnumberSeconds until the key expires; math.huge for lifetime keys.
SA_UserNotestringThe key's Name from the dashboard, "Not specified" if empty.
SA_ScriptVersionstringThe script's version, "1.0.0" by default.
SA_SessionIdstringSantiAuth only: the server session ID.
SA_SessionValidbooleanSantiAuth only: turns false when the server rejects the session (key disabled, banned or expired, script disabled) or after 3 heartbeats in a row can't reach the server.

Examples

Premium-only features

lua
if not SA_IsUserPremium then
    return print("This feature is Premium only")
end

Showing time left

lua
local left = SA_SecondsLeft == math.huge and "forever"
    or ("%d hours"):format(SA_SecondsLeft // 3600)

print(("Welcome back! %d executions, key valid for %s"):format(SA_TotalExecutions, left))

Stopping a loop when the session ends

lua
while SA_SessionValid do
    -- farm
    task.wait(1)
end