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

How to detect when Magnitude is changed?

so im currently trying to figure out how to do something i would imagine to look like this.

plr.Character.Humanoid.MoveDirection.Magnitude.Changed:Wait()

basically its for my sprinting script to make sure that the fov wont change while standing still, but will change when you start running, if you arent already moving before you press the key

sorry if this is confusing, im a bit tired because its 2:30 in the morning

1 answer

Magnitude is a property, you need to use .Changed on instances.

Example:

game.Workspace.IntValue.Changed:Connect(function()
	print("The IntValue has been changed!")
end)

Instead of:

game.Workspace.IntValue.Value.Changed:Connect(function()
	print("The IntValue has been changed!")
end)

1 comment

0

If the IntValue name changes, or the value gets changed, it will print. But if the IntValue parent changes, it will send an error. Well it's just an example so no worries! Bye

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