Sign In to Your Account

Manual registration is temporarily disabled. Please use Discord, Google or GitHub to create an account.

CONTINUE WITH
Anti-Constant Tamper [PROTECT CONSTANTS] - Universal Script | Free Roblox Script

Anti-Constant Tamper [PROTECT CONSTANTS]

Universal 2 views 6 hours ago
Anti-Constant Tamper [PROTECT CONSTANTS] - Roblox Script
Mobile Mobile Friendly
Key Key Required

Description

Credits: ace_gef

prevent your constants from being tampered with

117 Lines 2,154 Bytes
local raw = {
    skidding = "@ace_gef"
}

local sig = {
    skidding = 3207764976,
}

local keys = {
    "skidding",
}

local state = {
    checked = false,
    locked = false,
    cache = {}
}

local function hash(v)
    local s = tostring(v)
    local n = 2166136261

    for i = 1, #s do
        n = bit32.bxor(n, string.byte(s, i))
        n = (n * 16777619) % 4294967296
    end

    return n
end

local function fail(m)
    state.locked = true
    error(m, 2)
end

local function scan_known()
    for i = 1, #keys do
        local name = keys[i]
        local value = raw[name]
        local wanted = sig[name]

        if wanted == nil then
            fail("missing signature: " .. tostring(name))
        end

        if value == nil then
            fail("missing constant: " .. tostring(name))
        end

        if hash(value) ~= wanted then
            fail("constant changed: " .. tostring(name))
        end

        state.cache[name] = value
    end
end

local function scan_extra()
    for name in pairs(raw) do
        if sig[name] == nil then
            fail("unexpected constant: " .. tostring(name))
        end
    end
end

local function verify()
    if state.locked then
        fail("constant state locked")
    end

    scan_known()
    scan_extra()

    state.checked = true
end

local verifier = coroutine.create(function()
    verify()
    coroutine.yield(true)

    while true do
        verify()
        coroutine.yield(true)
    end
end)

local function pulse()
    local ok, result = coroutine.resume(verifier)

    if not ok or result ~= true then
        fail("verifier failed")
    end
end

local safe_constants = setmetatable({}, {
    __index = function(_, name)
        pulse()

        local value = state.cache[name]

        if value == nil then
            fail("invalid access: " .. tostring(name))
        end

        return value
    end,

    __newindex = function()
        fail("constants are readonly")
    end,

    __metatable = "locked"
})

pulse()

print(safe_constants.skidding)

Comments

Comments section coming soon...

Frequently Asked Questions

To use this script, you need a Roblox Executor. Simply copy the script from this page, paste it into your executor, and run it while you are in the Universal game.

This script may require a payment or subscription. Please check the script's description for more details.

Yes, this script has a key system. You may need to complete a task or join a Discord server to get a key.

Yes, this script is designed to be compatible with mobile executors.

Similar Scripts

Share Script

Share this script with others by copying the link or using your device's share options.

https://rbxscripts.net/scripts/anti-constant-tamper-protect-constants/
or

Report Script

Help us maintain a safe community. Your report will be reviewed by our moderation team and appropriate action will be taken if needed.

Select a reason...
Malicious Code
Inappropriate Content
Copyright Infringement
Spam
Misleading Information
Other