Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local MaxWalkSpeed = 16
- local CheckInterval = 1
- local function onPlayerAdded(player)
- local character = player.Character or player.CharacterAdded:Wait()
- --[[ monitor ws]]
- local humanoid = character:WaitForChild("Humanoid")
- humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
- if humanoid.WalkSpeed > MaxWalkSpeed then
- player:Kick("what the hell is u doing")
- end
- end);
- local lastpos = character.PrimaryPart.Position;
- RunService.Heartbeat:Connect(function()
- local kurrentPos=character.PrimaryPart.Position
- local distanxe = (kurrentPos - lastpos).magnitude
- if distanxe > (MaxWalkSpeed * CheckInterval * 1.5) then
- player:Kick("flying detekted")
- end
- lastpos = kurrentPos
- end)
- end;
- Players.PlayerAdded:Connect(onPlayerAdded)
- for _, player in pairs(Players:GetPlayers()) do
- onPlayerAdded(player)
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement