RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a roblox script where if a exploiter trys to fly it will kick them"
-- server script (ServerScriptService) local Players = game:GetService("Players") local function checkExploit(player) local character = player.Character if character then local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") local humanoid = character:FindFirstChild("Humanoid") if humanoidRootPart and humanoid then local velocity = humanoidRootPart.Velocity local speed = math.sqrt(velocity.X^2 + velocity.Y^2 + velocity.Z^2) if speed > humanoid.WalkSpeed * 1.5 then player:Kick("Flying exploit detected.") end end end end local function onPlayerAdded(player) player.CharacterAdded:Connect(function(character) character.HumanoidRootPart:GetPropertyChangedSignal("Velocity"):Connect(function() checkExploit(player) end) end) end Players.PlayerAdded:Connect(onPlayerAdded) for _, player in ipairs(Players:GetPlayers()) do onPlayerAdded(player) end