I'm trying to detect if my character has moved using this script:
local hrp = script.Parent.Parent:FindFirstChild("HumanoidRootPart") hrp.Changed:Connect(function(p) print(p) if p == "Position" then print("Your position has changed!") end end)
but for some reason it won't work
Edit: Nevermind i just put the script in the wrong place. If i put the script in starter player, then it works!
You can use a Humanoid.Running Event. There are other events but I forgot. So this is the script
char = script.Parent.Parent hum = char:WaitForChild("Humanoid") hum.Running:Connect(function(Speed) if Speed > 0 then --code end end