Advertisement
baconhack_263

Car Spawner

Dec 19th, 2023
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. -- UPDATING SOON
  2.  
  3. -- GUI VERSION 1.0
  4.  
  5. local main = Instance.new("ScreenGui")
  6. local Frame = Instance.new("Frame")
  7. local CarSpawn = Instance.new("TextButton")
  8. local DeleteCar = Instance.new("TextButton")
  9. local TextLabel = Instance.new("TextLabel")
  10. local removeallcar = Instance.new("TextButton")
  11. local carspeed = Instance.new("TextLabel")
  12.  
  13. -- FUNCTIONS
  14.  
  15. main.Name = "main"
  16. main.Parent = game.CoreGui
  17. main.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  18.  
  19. Frame.Parent = main
  20. Frame.BackgroundColor3 = Color3.fromRGB(123, 255, 247)
  21. Frame.BorderColor3 = Color3.fromRGB(103, 221, 213)
  22. Frame.Position = UDim2.new(0.100320168, 0, 0.379746825, 0)
  23. Frame.Size = UDim2.new(0, 190, 0, 57
  24.  
  25. spawncar.Name = "spawncar"
  26. spawncar.Parent = Frame
  27. spawncar.BackgroundColor3 = Color3.fromRGB(123, 255, 247)
  28. spawncar.Size = UDim2.new(0, 44, 0, 28)
  29. spawncar.Font = Enum.Font.SourceSans
  30. spawncar.Text = "Up"
  31. spawncar.TextColor3 = Color3.fromRGB(0, 0, 0)
  32. spawncar.TextSize = 14.000
  33.  
  34. desspawncar.Name = "desspawncar"
  35. desspawncar.Parent = Frame
  36. desspawncar.BackgroundColor3 = Color3.fromRGB(123, 255, 247)
  37. desspawncar.Position = UDim2.new(0, 0, 0.491228074, 0)
  38. desspawncar.Size = UDim2.new(0, 44, 0, 28)
  39. desspawncar.Font = Enum.Font.SourceSans
  40. desspawncar.Text = "desspawncar"
  41. desspawncar.TextColor3 = Color3.fromRGB(0, 0, 0)
  42. desspawncar.TextSize = 14.000
  43.  
  44. removeallcar.Name = "removeallcar"
  45. removeallcar.Parent = Frame
  46. removeallcar.BackgroundColor3 = Color3.fromRGB(123, 255, 247)
  47. removeallcar.Position = UDim2.new(0.702823281, 0, 0.491228074, 0)
  48. removeallcar.Size = UDim2.new(0, 56, 0, 28)
  49. removeallcar.Font = Enum.Font.SourceSans
  50. removeallcar.Text = "removeallcar"
  51. removeallcar.TextColor3 = Color3.fromRGB(0, 0, 0)
  52. removeallcar.TextSize = 14.000
  53.  
  54. TextLabel.Parent = Frame
  55. TextLabel.BackgroundColor3 = Color3.fromRGB(123, 255, 247)
  56. TextLabel.Position = UDim2.new(0.469327301, 0, 0, 0)
  57. TextLabel.Size = UDim2.new(0, 100, 0, 28)
  58. TextLabel.Font = Enum.Font.SourceSans
  59. TextLabel.Text = "BACONHACK_26 CAR SPAWNER"
  60. TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  61. TextLabel.TextScaled = true
  62. TextLabel.TextSize = 14.000
  63. TextLabel.TextWrapped = true
  64.  
  65. carspeed.Name = "carspeed"
  66. carspeed.Parent = Frame
  67. carspeed.BackgroundColor3 = Color3.fromRGB(123, 255, 247)
  68. carspeed.Position = UDim2.new(0.468421042, 0, 0.491228074, 0)
  69. carspeed.Size = UDim2.new(0, 44, 0, 28)
  70. carspeed.Font = Enum.Font.SourceSans
  71. carspeed.Text = "1"
  72. carspeed.TextColor3 = Color3.fromRGB(0, 0, 0)
  73. carspeed.TextScaled = true
  74. carspeed.TextSize = 14.000
  75. carspeed.TextWrapped = true
  76.  
  77. game.ReplicatedStorage.CarSpawn.OnServerEvent: Connect(function(player) local char player. Character or player.CharacterAdded: Wait()
  78. if not game.Workspace: FindFirstChild(player.Name.."Car") then age.Car:Clone() local car game. ReplicatedStorage.Car: Clone()
  79. car. Parent = workspace
  80. car: SetPrimary PartCFrame(char. Primary Part.CFrame CFrame.new(10,3,10))
  81. car.Name player.Name.."Car"
  82. end end)
  83. game.ReplicatedStorage.DeleteCar.OnServerEvent: Connect(function(player) if workspace: FindFirstChild(player.Name.."Car") then
  84. workspace: FindFirstChild(player.Name.."Car"): Destroy()
  85. end end)
  86.  
  87. spawncar.MouseButton1Down:connect(function()
  88. game.ReplicatedStorage.CarSpawn:FireServer()
  89.  
  90. end)
  91.  
  92. desspawncar.MouseButton1Down:connect(function()
  93.  
  94. game.ReplicatedStorage.DeleteCar:FireServer()
  95. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement