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

How do I check the position of this bowling pin?

Asked by
Kitorari 266 Moderation Voter
7 years ago
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..?

1
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. User#5423 17 — 7y

1 answer

Log in to vote
2
Answered by 7 years ago

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)
0
Thank you so much! Kitorari 266 — 7y
Ad

Answer this question