Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is this Anti-SpeedHack safe from exploiters?

So I have placed a local script inside a screen gui with the field 'Reset on Spawn' set to false. The script gets the name of the Local Player, then sets its Parent to nil. It works fine, but what I want to know is:

Would hackers and exploiters still be able to delete a 'nil instance'? Is this a sure-fire way to prevent speed hackers?

local plr = game:GetService("Players").LocalPlayer

while true do
	wait()
	script.Parent = nil --Setting the parent to nil so hackers cannot delete it
	local character = plr.Character
	local human = character:FindFirstChildOfClass("Humanoid")
	if human then
		if human.WalkSpeed > 16 then
			plr:Kick()
		end
	end
end

1 comment

0

DO NOT kick the player if they are caught, either reset their speed or respawn them. If the player is lagging then it's possible your script could trigger a false positive.

2 answers

✓ Accepted answer

I think the safest way is to make a script in the ServerScriptService

game.Players.PlayerAdded:Connect(function(plr)
	repeat wait() until plr.Character
	while true do
		wait()
		if plr.Character.Humanoid.WalkSpeed > 16 then
			plr:Kick()
		end
	end
end)

2 comments

0

If the player is an exploiter, the Server will not detect if his speed is changed. The best way in my opinion is to put that SpeedCheck in a LocalScript even if they can be deleted.

0

how putting it in a local script better i, it can be deleted

Putting the script in a localscript is not very safe.. because it could simply be deleted; so put this in a Server script, somewhere in ServerScriptService..

try to hook every statement with an event to reduce memory consumption, the bigger memory consumption, the laggy your game is..

local maxSpeed = 16 -- change to the absolutely max speed in game
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid");
		
		if humanoid then
			humanoid.Changed:Connect(function()
				if humanoid.WalkSpeed > maxSpeed then
					player:Kick("You just can't win  without cheating, can you? /:")
				end
			end)
		end

	end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.