Advertisement
Yusuf1987

Emergency Hamburg Car steal

Nov 22nd, 2024
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.94 KB | Source Code | 0 0
  1. local Vehicles = workspace.Vehicles
  2.  
  3. local function Notification(Title, Description)
  4.     game:GetService("StarterGui"):SetCore("SendNotification", {
  5.         Title = Title,
  6.         Text = Description
  7.     })
  8. end
  9.  
  10. local Gui = Instance.new("ScreenGui")
  11. Gui.Parent = game.Players.LocalPlayer.PlayerGui
  12. Gui.ResetOnSpawn = false
  13. local Button = Instance.new("TextButton", Gui)
  14. Button.BackgroundTransparency = 1
  15. Button.TextScaled = true
  16. Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  17. Button.Text = "Go to your car"
  18. Button.Size = UDim2.new(0.2, 0, 0.05, 0)
  19. Button.Position = UDim2.new(0.4, 0, 0, 0)
  20.  
  21. local function SetupCarInteractions()
  22.     for _, vehicle in ipairs(Vehicles:GetChildren()) do
  23.         local clickDetector = vehicle:FindFirstChild("ClickDetector")
  24.         if not clickDetector then
  25.             clickDetector = Instance.new("ClickDetector")
  26.             clickDetector.Parent = vehicle
  27.             clickDetector.MaxActivationDistance = math.huge
  28.         end
  29.  
  30.         if not clickDetector:GetAttribute("Connected") then
  31.             clickDetector.MouseClick:Connect(function()
  32.                 local car = clickDetector.Parent
  33.                 if car then
  34.                     if car.DriveSeat:FindFirstChild("SeatWeld") then
  35.                         Notification("Error", "The car you've been trying to enter currently has a driver named " .. car.Name .. ".")
  36.                     else
  37.                         car.DriveSeat:Sit(game.Players.LocalPlayer.Character.Humanoid)
  38.                     end
  39.                 end
  40.             end)
  41.             clickDetector:SetAttribute("Connected", true)
  42.         end
  43.     end
  44. end
  45.  
  46. Button.Activated:Connect(function()
  47.     if Vehicles:FindFirstChild(game.Players.LocalPlayer.Name) then
  48.         Vehicles[game.Players.LocalPlayer.Name].DriveSeat:Sit(game.Players.LocalPlayer.Character.Humanoid)
  49.     end
  50. end)
  51.  
  52. task.spawn(function()
  53.     while task.wait(0.5) do
  54.         SetupCarInteractions()
  55.     end
  56. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement