Anti Exploit Not Working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I am making an anti exploit for my friend but it is not working.
    It says “Attempt to index nil with humanoid”, I however don’t understand why this is happening.
local whitelist = {"phyouthcenter1"} -- Add your name here, and others you trust!

while wait(1) do
	for _,v in pairs(game.Players:GetChildren()) do
		if v.Character.Humanoid.Walkspeed ~= 16 or v.Character.Humanoid.JumpPower ~= 50 then
			if _G.Adonis then
				if _G.Adonis.CheckLevel(v) == 0 then
					v:Kick("Exploiting")
				end
			else
				if not table.find(whitelist, v.Name) then
					v:Kick("Exploiting")
				end
			end
		end
	end
end

PS: When this is fixed feel free to take it and customize it. :slight_smile:

Your ‘anti exploit’ wouldn’t work regardless. If this is on the server, the server wouldn’t see what the client is doing and if this is on the client, an exploiter can just delete your script and/or whitelist themselves.

Anyway, your code should be this:

local whitelist = {"phyouthcenter1"} -- Add your name here, and others you trust!

while wait(1) do
	for _,v in pairs(game.Players:GetPlayers()) do
        -- use 'GetPlayers' not 'GetChildren'
        local c = v.Character or v.CharacterAdded:Wait() -- get the player's character or wait for it to load

		if c:WaitForChild("Humanoid").Walkspeed ~= 16 or c.Humanoid.JumpPower ~= 50 then
			if _G.Adonis then
				if _G.Adonis.CheckLevel(v) == 0 then
					v:Kick("Exploiting")
				end
			else
				if not table.find(whitelist, v.Name) then
					v:Kick("Exploiting")
				end
			end
		end
	end
end

Oh, ok.
Thank you for bringing this to my attention!