Greetings developers, so I am working on a pit maneuverer system and it works, once you pit the vehicle, the 2 front wheels turn but it then they go back to normal and don’t stop the vehicle.
Script:
script.Parent.Touched:Connect(function(hit)
if hit.Name == "pitZoneDetector" then
if script.Parent.Parent.Parent.canPit.Value == true then
for i = 1,25 do
wait()
script.Parent.Parent.Parent.Wheels.FL.CFrame = CFrame.new(script.Parent.Parent.Parent.Wheels.FL.Position) * CFrame.Angles(90, math.rad(180), 0)
script.Parent.Parent.Parent.Wheels.FR.CFrame = CFrame.new(script.Parent.Parent.Parent.Wheels.FR.Position) * CFrame.Angles(90, -math.rad(180), 0)
script.Parent.Parent.Parent.Wheels.RL.ParticleEmitter.Enabled = true
script.Parent.Parent.Parent.Wheels.RR.ParticleEmitter.Enabled = true
wait(3)
script.Parent.Parent.Parent.Wheels.RL.ParticleEmitter.Enabled = false
script.Parent.Parent.Parent.Wheels.RR.ParticleEmitter.Enabled = false
break
end
end
end
end)
Help would be highly appreciated.