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

How do I make hingecontraints not being able to be stopped?

Asked by 4 years ago
Edited 4 years ago
script.Parent.HingeConstraint.ServoMaxTorque = math.huge
script.Parent.HingeConstraint.AngularSpeed = 0.1
workspace.Gate.HingeConstraint.ServoMaxTorque = math.huge


workspace.off.ClickDetector.MouseClick:Connect(function()
    script.Parent.HingeConstraint.TargetAngle = 0
    workspace.Gate.HingeConstraint.TargetAngle = 0
end)

workspace.on.ClickDetector.MouseClick:Connect(function()
    script.Parent.HingeConstraint.TargetAngle = 100
    workspace.Gate.HingeConstraint.TargetAngle = 100
end)

workspace.STOP.ClickDetector.MouseClick:Connect(function()
    script.Parent.HingeConstraint.TargetAngle = script.Parent.HingeConstraint.CurrentAngle
    workspace.Gate.HingeConstraint.TargetAngle = workspace.Gate.HingeConstraint.CurrentAngle
end)

spawn(function()
    while wait() do
        print(script.Parent.HingeConstraint.TargetAngle)
    end
end)

In this script, if I block the doors from closing, they do not close. How would I fix it so that they cannot be stopped if someone is in their way?

Answer this question