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

Hello any help on this delete vehicle script?

Asked by 6 years ago
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
0
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? fredfishy 833 — 6y

1 answer

Log in to vote
0
Answered by
mraznboy1 194
6 years ago
Edited 6 years ago
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.

0
What should i put there instead because it keeps looping. elinaliga 0 — 6y
Ad

Answer this question