I'm trying to make a lowrider car that bounces when the option is ticked inside of a GUI, problem I'm having is not being able to loop the bouncing part, and then also breaking the loop and resetting the ride height to normal when the option is no longer ticked in the GUI.
SuspensionSection:NewToggle("Bounce", "Bounce like a lowrider", function(state)
Variables()
while state == true do
game:GetService("Workspace")[PlayerName.."Car"].Wheels.FL.Spring.FreeLength = 2.35
game:GetService("Workspace")[PlayerName.."Car"].Wheels.FR.Spring.FreeLength = 2.35
game:GetService("Workspace")[PlayerName.."Car"].Wheels.RL.Spring.FreeLength = 2.35
game:GetService("Workspace")[PlayerName.."Car"].Wheels.RR.Spring.FreeLength = 2.35
wait(0.5)
game:GetService("Workspace")[PlayerName.."Car"].Wheels.FL.Spring.FreeLength = 3
game:GetService("Workspace")[PlayerName.."Car"].Wheels.FR.Spring.FreeLength = 3
game:GetService("Workspace")[PlayerName.."Car"].Wheels.RL.Spring.FreeLength = 3
game:GetService("Workspace")[PlayerName.."Car"].Wheels.RR.Spring.FreeLength = 3
else
game:GetService("Workspace")[PlayerName.."Car"].Wheels.FL.Spring.FreeLength = 2.35
game:GetService("Workspace")[PlayerName.."Car"].Wheels.FR.Spring.FreeLength = 2.35
game:GetService("Workspace")[PlayerName.."Car"].Wheels.RL.Spring.FreeLength = 2.35
game:GetService("Workspace")[PlayerName.."Car"].Wheels.RR.Spring.FreeLength = 2.35
end
end)
Any help is appreciated, thanks.
