ui.DelVehicle.MouseButton1Click:connect(function()
if workspace:FindFirstChild(plr.Name.."Car") then
workspace:FindFirstChild(plr.Name.."Car"):Destroy()
ui.DelVehicle.tt.Text="Successfully deleted." wait(2)
ui.DelVehicle.tt.Text="Delete vehicle"
while true do
if "CARNAMEHERE" then money.Value = money.Value + 100
else
for i=1,3 do
ui.DelVehicle.tt.Text="No car to delete!" wait(0.3)
if i~=3 then
ui.DelVehicle.tt.Text="" wait(0.3)
end
end
ui.DelVehicle.tt.Text="Delete vehicle"
end
COMMUNITY QUESTION
Hello any help on this delete vehicle script?
1 answer
ui.DelVehicle.MouseButton1Click:connect(function()
if workspace:FindFirstChild(plr.Name.."Car") then
workspace:FindFirstChild(plr.Name.."Car"):Destroy()
ui.DelVehicle.tt.Text="Successfully deleted." wait(2)
ui.DelVehicle.tt.Text="Delete vehicle"
while true do
if "CARNAMEHERE" then --this will crash your script, because there is no wait between the loops and this value will always be true
money.Value = money.Value + 100
end
end
else
for i=1,3 do
ui.DelVehicle.tt.Text="No car to delete!" wait(0.3)
if i~=3 then
ui.DelVehicle.tt.Text="" wait(0.3)
end
end
ui.DelVehicle.tt.Text="Delete vehicle"
end
end)
you didn't close off your "while" loop and were missing a few ends.
1 comment
0
What should i put there instead because it keeps looping.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
What is it supposed to do? What is it not doing? What are the error messages you get? What do you want us to do?