Hey, Im not used to using a Getpropertychanged event, but I tried doing it here so that I can have a part that keeps spinning on its Y axis, but Im getting an error that says that 0, 50, 0 is not a valid property
script.Parent:GetPropertyChangedSignal(script.Parent.AssemblyAngularVelocity):Connect(function(property)
property = script.Parent.AssemblyAngularVelocity
if property.Y ~= 50 then
property = Vector3.new(0, 50, 0)
end
end)
GetPropertyChangedSignal only accepts strings as an argument not vectors.
-- The code thinks that you are trying to
-- find the property called `Vector3.new(0, 50, 0)`
script.Parent:GetPropertyChangedSignal(script.Parent.AssemblyAngularVelocity)
-- Solution
script.Parent:GetPropertyChangedSignal("AssemblyAngularVelocity")
function Changed()
if script.Parent.AssemblyAngularVelocity ~= Vector3.new(0, 50, 0) then
script.Parent.AssemblyAngularVelocity = Vector3.new(0, 50, 0)
else return
end
end
script.Parent:GetPropertyChangedSignal("AssemblyAngularVelocity"):Connect(Changed)