Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Would this code system be secure or be a good way to do it?

Asked by
LuaDLL 253 Moderation Voter
4 years ago
Edited 4 years ago

Would It Be Good To Use string.split?

Example:

local Codes = {
    "FREE/2500/Zin",
    "FR33/5/Level",
}

function TryCode(FakeCode)

    for _,Code in pairs(Codes) do

        local RealCode = string.split(Code,"/")

        --[[
            RealCode[1] would be the code in the codes table
            RealCode[2] would be the amount of the reward
            RealCode[3] would be what the reward is
        ]]--

        if RealCode[1] == FakeCode then

            print("Award "..RealCode[2].." "..RealCode[3].."(s)")

        end

    end

end


0
me either until now, I never new string.split existed until my friend has told me. I'm just woundering if it would be any good use for something simple like this LuaDLL 253 — 4y
0
This may be unconventional but: https://wiki.garrysmod.com/page/string/Split NIMI5Q -2 — 4y

Answer this question