Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to detect when Magnitude is changed?

Asked by
if3q 6
3 years ago

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

Log in to vote
-1
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago

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)
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 Xapelize 2658 — 3y
Ad

Answer this question