local plrs = game:GetService("Players");
plrs.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait();
local human = char:WaitForChild("Humanoid");
human.Running:Connect(function(speed)
if speed >= 18 then
plr:Kick("Exploiting");
end;
end);
end);
-- This is a server script.
You would want to use the :GetPropertyChangedSignal() method as stated by @lotalunic
So something like this
-- Client
local PlayerService = game:GetService("Players")
local LocalPlayer = PlayerService.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local ExploitingSpeed = 18
local function CheckWS()
if Humanoid.WalkSpeed >= 18 then
print("Exploiting")
end
end
Humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(CheckWS)