Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I Can't Detect when a player moves?

I am trying do detect when a player moves, im trying to do that by asking if its position is different, but it doesn't work.

local Player = game.Players.LocalPlayer
local Char = Player.Character

if Char then
	local H = Char:WaitForChild("MainSphere")
	if H then
		if H.Position ~= H.Position then
			print("Yes")
		end
	end
end

it prints out "Yes" once, but never after.

1 comment

0

use humanoid.Running

1 answer

✓ Accepted answer

do

local speed
local hum = --get the players humanoid here
hum.Running:Connect(function(sps)--studs per second(name that whatever)
	speed = sps
end
while wait(3) do
	print(speed,"is your current speed!")
end

if the players speed changes then the var, speed also updates hope this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.