I'm experimenting with loops inside of loops and this is my first attempt, but when I click, Studio will always crash and I don't know why. Here is script:
loop = 1
while true do
while loop < 8 do
wait(1)
script.Parent.Parent.HingeConstraint.TargetAngle = script.Parent.Parent.HingeConstraint.TargetAngle - 6
loop = math.random(1,10)
end
local CD = script.Parent -- Clickdetector
CD.MouseClick:connect(function(click)
loop = math.random(1,7)
end)
end

2 comments
Try adding a wait() right above the last end
why are you making your event inside loop?,you don't need 2 loop for this script