script.Parent.Vector3.Changed:connect(function()
workspace.PartScoreBoard.SurfaceGui.Frame.Pin1.BackgroundColor3 = Color3.new(1, 0, 1)
end)
It says Changed is not a valid member of vector3...
How do I check if the pin has been moved..?
script.Parent.Vector3.Changed:connect(function()
workspace.PartScoreBoard.SurfaceGui.Frame.Pin1.BackgroundColor3 = Color3.new(1, 0, 1)
end)
It says Changed is not a valid member of vector3...
How do I check if the pin has been moved..?
Hi there! I looked at your script, and quickly found your mistake. Your mistake is that you attempted to see if script.Parent's Vector3 changed, and there is no property named Vector3! Its only Position which is in the value form of Vector3. Here is the fixed script:
script.Parent.Changed:connect(function(prop) --the function "changed" has an arg, and the arg is for what property changed.
if prop == "Position" then -- checking if the property is the position, which is Vector3
workspace.PartScoreBoard.SurfaceGui.Frame.Pin1.BackgroundColor3 = Color3.new(1,0,1)
print(script.Parent[prop]) -- this is here just to check the new value, erase if you please.
end
end)
Thank you so much!
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
You can save the position of all of the bowling pins then compare them. This will also count pins that have be moved but not fallen. To solve this you can also compare the rotation of the pin.