Advertisement
Yusuf1987

Emergency Hamburg upgraded car

Nov 22nd, 2024 (edited)
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | Source Code | 0 0
  1. local Vehicles = workspace.Vehicles
  2.  
  3. task.spawn(function()
  4.     if Vehicles then
  5.         while task.wait() do
  6.             for i,CurrentCar in ipairs(Vehicles:GetChildren()) do
  7.             if CurrentCar ~= nil then
  8.                 local Speed = CurrentCar:GetAttribute("MaxSpeed")
  9.                 CurrentCar:SetAttribute("CurrentMaxSpeed", Speed)
  10.                
  11.                 if not CurrentCar:GetAttribute("MaxSpeedIncreased") then
  12.                     CurrentCar:SetAttribute("MaxSpeed", Speed + 50)
  13.                     CurrentCar:SetAttribute("MaxSpeedIncreased", true)
  14.                 end
  15.                
  16.                 if CurrentCar.DriveSeat:FindFirstChild("Engine") then
  17.                     CurrentCar.DriveSeat.Engine.SoundId = "rbxassetid://1160914875"
  18.                 elseif CurrentCar.DriveSeat:FindFirstChild("TruckEngine") then
  19.                     CurrentCar.DriveSeat.TruckEngine.SoundId = "rbxassetid://1160914875"
  20.                 end
  21.  
  22.                 if CurrentCar.DriveSeat:FindFirstChild("EngineOff") then
  23.                     CurrentCar.DriveSeat.EngineOff.SoundId = "rbxassetid://268260239"
  24.                 end
  25.  
  26.                 if CurrentCar.DriveSeat:FindFirstChild("EngineOn") then
  27.                     CurrentCar.DriveSeat.EngineOn.SoundId = "rbxassetid://402899121"
  28.                 end
  29.  
  30.                 CurrentCar:SetAttribute("MaxAccelerateForce", 1000)
  31.                 CurrentCar:SetAttribute("MaxBrakeForce", 1000)
  32.                 CurrentCar:SetAttribute("MinAccelerateForce", 350)
  33.                 CurrentCar:SetAttribute("MinBrakeForce", 750)
  34.                 CurrentCar:SetAttribute("ShowElectric", true)
  35.                 CurrentCar:SetAttribute("Type", "electric")
  36.             end
  37.             end
  38.         end
  39.     end
  40. end)
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement