I need help for this script, It doesnt let me delete the car if i already sat on the driveseat.
Script:
local P = script.Parent local player = script.Parent.Parent.Parent.Name--P.Parent.Parent local B = P.B B.MouseButton1Click:connect(function() if game.Workspace:FindFirstChild(player.."Car") then game.Workspace[player.."Car"]:Destroy() B.Text = "Mobil Dihapus" wait(2) B.Text = "Hapus Mobil" else game.Workspace[player.."Car"]:Destroy() B.Text = "Tidak Ada Mobil" wait(2) B.Text = "Hapus Mobil" end end)
Here is the code organised if anyone needs it (including me hehe):
local P = script.Parent local player = script.Parent.Parent.Parent.Name local B = P.B B.MouseButton1Click:connect(function() if game.Workspace:FindFirstChild(player.."Car") then game.Workspace[player.."Car"]:Destroy() B.Text = "Mobil Dihapus" -- "Car Deleted" wait(2) B.Text = "Hapus Mobil" -- "Delete Car" else game.Workspace[player.."Car"]:Destroy() B.Text = "Tidak Ada Mobil" -- "No Car Found" wait(2) B.Text = "Hapus Mobil" -- "Delete Car" end end)
And the language is in Indonesia, hooray.