local char = game.Workspace:FindFirstChild("Humanoid") if char.walkspeed>16 then print("you hacker") end
Workspace.Script:1: attempt to index a nil value is the error.
My intentions are to make sure no one is speed hacking in my game, sense filteredenabled doesn't cover that. I want to eventually ban the player for the game in the if statement, but I used print to make sure it works, which it doesn't.
game.Players.PlayerAdded:Connect(function(P) --When a player join this code run P.CharacterAdded:Connect(function(C) -- This check if the character spawned local Hum = C:FindFirstChild("Humanoid") --This find the humanoid Hum.Changed:Connect(function(Prop) -- This run when a property of the humanoid changes if Hum.WalkSpeed>16 then --If the walkspeed is superior to 16 P:Kick("you hacker") --Kick the player end end) end) end)
I hope this help :)
Do you wan't help and there is the script:
local char = game.Players.LocalPlayer.Character.Humanoid local player = game.Players.LocalPlayer if char.WalkSpeed == 16 then player:Kick("you hacker") end
while true do wait(.01) local player = game.Players.LocalPlayer local char = player.Char or player.CharacterAdded:() if char.Humanoid.WalkSpeed >16 then print("you're a hacker, be gone") player:Kick("Exploiting") wait(.01)
Basicly u scripted it wrong.
-- Local Script -- Put inside StarterGui local player = game:GetService("Players").LocalPlayer local char = player.Character game.Players.PlayerAdded:Connect(function() wait(0.1) if char:WaitForChild("Humanoid").WalkSpeed = 16 then print(Player.Name.. " is not a hacker." else print(Player.Name.. " is hacker." end end()