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

My security feature is not working..?

Asked by
IcyEvil 260 Moderation Voter
8 years ago

I need help with my security feature it just is not working.

It is supposed to check if a certain value subtracted by two is equal to two certain UserId but if it isnt it prints 'Bad boy...'

and then destroys the script.

here is the entire script

local primarch = {34504596,41538450,42890850,15085045,648842,96442418,110087622,47155533,82861505}
local gid = 2712469
local minrank = 6
game.Players.PlayerAdded:connect(function(plr)
    local rank = plr:GetRankInGroup(gid)
    if rank <= minrank then
        for _,v in pairs(primarch)do
        if plr.UserId == v then
            plr.Chatted:connect(function(msg)
                if string.lower(msg) == "load sft" then
                    x = game.ServerStorage.sft:Clone()
                    local h = Instance.new("Hint", game.Workspace)
                    h.Text = "Loading //:SwordFight:\\"
                    wait(3)
                    x.Parent = game.Workspace
                    wait(2)
                    h:Destroy()
                end
            end)
            end
        end
    end
end)
game.Players.PlayerAdded:connect(function(plr)
    local rank = plr:GetRankInGroup(gid)
    if rank <= minrank then
        for _,v in pairs(primarch)do
        if plr.UserId == v then
            plr.Chatted:connect(function(msg)
                if string.lower(msg) == "end sft" then
                    x = game.Workspace.sft
                    local h = Instance.new("Hint", game.Workspace)
                    h.Text = "Ending //:SwordFight:\\"
                    wait(3)
                    x:Destroy()
                    wait(2)
                    h:Destroy()
                end
            end)
            end
        end
    end
end)
local gear = {34504598,41538452} -- this line and below are hurting the script.
for _,v in pairs(gear) do
    if game.CreatorId == v - 2 then
     print('Good')
    elseif game.CreatorId ~= v - 2 then
        print('Bad boy...')
            script:Destroy()
            end
        end

Answer this question