Most people have noclip hacks so how do I stop them.
How do I make a script where it kills someone when they noclip?
3 answers
I never created a anti no clip script, but here is an idea: Use raycasting from their last position to their current position and check if the ray intersects a part that is collidable. If it intersects, you can kick, ban or kill them.
It honestly depends on your situation. If you're creating a VIP room or whatever then just create a block a little smaller than the entire room size, then if a player touches it and they don't have VIP then kill, kick, or ban the player. If it's for buildings and such you could use Raycasting which is very complicated in my opinion. Luckily a thread has been made on the ROBLOX dev forums already. Here's the thread and hopefully it'll help you out in some form:
https://devforum.roblox.com/t/ways-to-patch-common-exploits/98961
Or just use a script like this.
script.Parent = game.Workspace
Rig = "R15"
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
if Rig == "R15" then
while wait() do
if char:WaitForChild("UpperTorso").CanCollide == false then
plr:Kick("Suspicious Movement")
end
wait(5)
end
elseif Rig == "R6" then
while wait() do
if char:WaitForChild("Torso").CanCollide == false then
plr:Kick("Suspicious Movement")
end
wait(5)
elseif Rig ~= "R6" and Rig ~= "R15" then
error("Please set Rig to either R15 or R6. This is case sensitive.")
end
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
how do I do that