I'm trying to make a theme park ride with a motor for the thing that holds you in the ride. So I added weldconstraints, the script enables the weldconstraints so that it holds the motor because it would glitch out when the ride is in motion. I have tested this without the script works perfect. But for some reason the script wont detect the boolvalue when it is changed.
Btw the scripts inside a model
Here's the script:
Hold = script.Parent.Parent.Parent.Parent.Hold Hold.Changed:Connect(function() print("ugh") --This word wont print if Hold.Value == true then script.Parent.Enabled = true end if Hold.Value == false then script.Parent.Enabled = false end end)
You need to use script.Parent.Enabled.Value, which changed the value of the boolean, else it does not change the value, just the boolean value itself so use:
Hold = script.Parent.Parent.Parent.Parent.Hold Hold.Changed:Connect(function() print("ugh") if Hold.Value == true then script.Parent.Enabled.Value = true --Need to access .Value to change the value of any variable end if Hold.Value == false then script.Parent.Enabled.Value = false end end)