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

Will my anti-cheat script work if I put it in server script service?

Asked by 2 years ago

I do know a bit about filtering enabled and if I want to make stuff secure then I should put it in the server if possible. I need help if this would be secure and I Roblox keeps blocking those notifications when someone is exploiting in my game.

This is the code

local players = game.Players

local kickMessage = "The NS Anti-Cheat system has determined that you are cheating. If you think you're not cheating then please open a support ticket on our discord server. This message has been logged in our discord server, and will stay there for a week."
local httpService = game:GetService("HttpService")
local webhook = [Redacted] -- I don't want anyone posting stuff in my discord server with this bot.

function sendMessage(Message)
    local data = {
        ["content"] = Message
    }
    data = httpService:JSONEncode(data)
    httpService:PostAsync(webhook, data)    
end


players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        print("Character has been added")
        while true do
            wait(0.1)
            local succses, errorMessage = pcall(function()--pcall is used so the script wont crash.
                local humanoid = character.Humanoid
                --Anti Cheat if statments--
                local function kickCheater (reasons)
                    warn("Cheater detected")
                    player:Kick(kickMessage)
                end

                if humanoid.MaxHealth > 100 then
                    sendMessage(tostring(player.UserId)..": This player has been caught using health hacks")
                    wait(1)
                    kickCheater()
                elseif humanoid.WalkSpeed > 16 then
                    sendMessage(tostring(player.UserId)..": This player has been caught using speed hacks")
                    wait(1)
                    kickCheater()
                elseif humanoid. then


                end
            end)
            if errorMessage then
                warn(errorMessage)
            end
        end
    end)
end)

I don't have too much experience scripting because I have just started.

0
I think you should just use sanity checks instead of an anticheat in my opinion. echobloxia 21 — 2y
0
Are you using a proxy server or are you using the official discord webhook link? Because if you're using the discord webhook link, you wouldn't be able to post it in-game since Discord has blocked Roblox's HTTP requests. NotThatFamouss 605 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

This will only work IF the exploiter is using a server-side exploit; which in most cases, is gotten from backdoors. But if they're using the regular exploit (which is client-sided), no. The server wouldn't be able to detect changes.

0
how would be able to make it detect changes then nicemorew 26 — 2y
Ad

Answer this question