How to get character property from local script

How do you get the player character or it’s children properties, i try to make a script that check if player head X axis >= 120 then it will trigger function, but building the script already have an issue.

--- local script, on startercharacterscript
repeat task.wait() until game:IsLoaded()

local player = game:GetService("Players").LocalPlayer
local char = player.Character

local head = char:WaitForChild("Head")

print("Run")

head:GetPropertyChangedSignal("Position"):Connect(function()
	print("okay?")
end)

How do i get the player properties?

Physics don’t trigger Changed signal, so you have to use loop there.

This event does not fire for physics-related changes, such as when the CFrame, AssemblyLinearVelocity, AssemblyAngularVelocity, Position, or Orientation properties of a BasePart change due to gravity. To detect changes in these properties, consider using a physics-based event like RunService.PreSimulation.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.