Why do I get the error Passed value is not a function?

I’m trying to make a script to check if the car flips and if so then it will reorient the Main part.

script.Parent.Orientation.Z:GetPropertyChangedSignal("Value"):Connect(function()
	if script.Parent.Orientation.Z > 90 then
		script.Parent.Parent.Main.Orientation.Z = 0
	end
end)

I get the error in the :GetPropertyChangedSignal but specifically “Attempt to connect failed: Passed value is not a function”

Is script.Parent.Orientation a object? If not you can try this

script.Parent:GetPropertyChangedSignal("Orientation"):Connect(function()
	if script.Parent.Orientation.Z > 90 then
		script.Parent.Parent.Main.Orientation.Z = 0
	end
end)

It doesn’t seem to work still. The only thing I added was to check for the other way around but before I thought it worked but it turned out it didn’t

script.Parent.Parent.Main:GetPropertyChangedSignal("Orientation"):Connect(function()
	if script.Parent.Parent.Main.Orientation.X > 90 then
		script.Parent.Parent.Main.Orientation.X = 0
	elseif script.Parent.Parent.Main.Orientation.X < -90 then
		script.Parent.Parent.Main.Orientation.X = 0
	end
end)

I believe you can’t change an orientation on one axis only. You would have to create a new Vector3 Value, with the orientation on each axis the same and, just change the orientation on the z-axis.

local part = script.Parent

part:GetPropertyChangedSignal("Orientation"):Connect(function()
    if script.Parent.Orientation.Z > 90 then
		part.Orientation = Vector3.new(part.Orientation.X, part.Orientation.Y, 0)
	elseif part.Orientation.Z < -90 then
		part.Orientation = Vector3.new(part.Orientation.X, part.Orientation.Y, 0)		
	end
end)