TotallyGames

Untitled

Feb 17th, 2024
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | Source Code | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2. local DeleteCarEvent = ReplicatedStorage:WaitForChild("DeleteCar")
  3. local player = game.Players.LocalPlayer
  4.  
  5. game.Workspace.ChildAdded:Connect(function(Added)
  6.     if Added.Name == player.Name .. 'sCar' then
  7.         script.Parent.Visible = true
  8.     end
  9. end)
  10.  
  11. script.Parent.MouseButton1Down:Connect(function()
  12.     local Car = game.Workspace:FindFirstChild(player.Name .. 'sCar')
  13.     if Car then
  14.         script.Parent.Visible = false
  15.         if player.Character.Humanoid.SeatPart ~= nil and player.Character.Humanoid.SeatPart:IsA("VehicleSeat") then
  16.             player.Character.Humanoid.Sit = false
  17.         end
  18.         wait()
  19.         DeleteCarEvent:FireServer(Car)
  20.     end
  21. end)
Add Comment
Please, Sign In to add comment