pizzaloiopo

Vehicle simulator - OP

Jun 30th, 2018
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.90 KB | None | 0 0
  1. currentspeed = "600"
  2. mouse = game.Players.LocalPlayer:GetMouse()
  3.  
  4. -- Objects
  5.  
  6. local VehicleSimGui = Instance.new("ScreenGui")
  7. local MainFrame = Instance.new("Frame")
  8. local BackgroundImage = Instance.new("ImageLabel")
  9. local BackgroundFrame = Instance.new("Frame")
  10. local BackgroundFrame_2 = Instance.new("Frame")
  11. local switchvehicle = Instance.new("TextButton")
  12. local changespeed = Instance.new("TextButton")
  13. local vehiclespeedinput = Instance.new("TextBox")
  14. local switchvehicle_2 = Instance.new("TextButton")
  15. local exit = Instance.new("TextButton")
  16. local open = Instance.new("TextButton")
  17. local Credit = Instance.new("TextLabel")
  18. local Credit2 = Instance.new("TextLabel")
  19. local IntroWait = Instance.new("Frame")
  20. local TextLabel = Instance.new("TextLabel")
  21. local IntroFrame = Instance.new("Frame")
  22. local Square = Instance.new("TextLabel")
  23.  
  24. -- Properties
  25.  
  26. VehicleSimGui.Name = "VehicleSimGui"
  27. VehicleSimGui.Parent = game.CoreGui
  28.  
  29. MainFrame.Name = "MainFrame"
  30. MainFrame.Parent = VehicleSimGui
  31. MainFrame.Active = true
  32. MainFrame.BackgroundColor3 = Color3.new(0.415686, 0.415686, 0.415686)
  33. MainFrame.BorderSizePixel = 0
  34. MainFrame.Position = UDim2.new(0.19284603, 0, 0.259906769, 0)
  35. MainFrame.Selectable = true
  36. MainFrame.Size = UDim2.new(0, 832, 0, 430)
  37. MainFrame.Visible = false
  38. MainFrame.Draggable = true
  39.  
  40. BackgroundImage.Name = "BackgroundImage"
  41. BackgroundImage.Parent = MainFrame
  42. BackgroundImage.BackgroundColor3 = Color3.new(1, 1, 1)
  43. BackgroundImage.BackgroundTransparency = 1
  44. BackgroundImage.BorderSizePixel = 0
  45. BackgroundImage.Size = UDim2.new(0, 835, 0, 425)
  46. BackgroundImage.Image = "rbxassetid://1882514406"
  47. BackgroundImage.ImageTransparency = 0.5
  48.  
  49. BackgroundFrame.Name = "BackgroundFrame"
  50. BackgroundFrame.Parent = MainFrame
  51. BackgroundFrame.BackgroundColor3 = Color3.new(0.0352941, 0.643137, 0.827451)
  52. BackgroundFrame.BorderSizePixel = 0
  53. BackgroundFrame.Position = UDim2.new(0.000548228621, 0, 0.987786651, 0)
  54. BackgroundFrame.Size = UDim2.new(0, 835, 0, 5)
  55.  
  56. BackgroundFrame_2.Name = "BackgroundFrame"
  57. BackgroundFrame_2.Parent = MainFrame
  58. BackgroundFrame_2.BackgroundColor3 = Color3.new(0.0352941, 0.643137, 0.827451)
  59. BackgroundFrame_2.BorderSizePixel = 0
  60. BackgroundFrame_2.Position = UDim2.new(0.000548228621, 0, -0.000585436821, 0)
  61. BackgroundFrame_2.Size = UDim2.new(0, 835, 0, 5)
  62.  
  63. switchvehicle.Name = "switchvehicle"
  64. switchvehicle.Parent = MainFrame
  65. switchvehicle.BackgroundColor3 = Color3.new(0.0980392, 0.803922, 1)
  66. switchvehicle.BorderSizePixel = 0
  67. switchvehicle.Position = UDim2.new(0.106635079, 0, 0.260465115, 0)
  68. switchvehicle.Size = UDim2.new(0, 200, 0, 50)
  69. switchvehicle.Font = Enum.Font.ArialBold
  70. switchvehicle.Text = "Switch Vehicle"
  71. switchvehicle.TextColor3 = Color3.new(0, 0, 0)
  72. switchvehicle.TextScaled = true
  73. switchvehicle.TextSize = 14
  74. switchvehicle.TextWrapped = true
  75.  
  76. changespeed.Name = "changespeed"
  77. changespeed.Parent = MainFrame
  78. changespeed.BackgroundColor3 = Color3.new(0.235294, 1, 0.592157)
  79. changespeed.BorderSizePixel = 0
  80. changespeed.Position = UDim2.new(0.63625598, 0, 0.555813968, 0)
  81. changespeed.Size = UDim2.new(0, 200, 0, 50)
  82. changespeed.Font = Enum.Font.Fantasy
  83. changespeed.Text = "Change Speed"
  84. changespeed.TextColor3 = Color3.new(0, 0, 0)
  85. changespeed.TextScaled = true
  86. changespeed.TextSize = 14
  87. changespeed.TextWrapped = true
  88.  
  89. vehiclespeedinput.Name = "vehiclespeedinput"
  90. vehiclespeedinput.Parent = MainFrame
  91. vehiclespeedinput.BackgroundColor3 = Color3.new(1, 0, 0)
  92. vehiclespeedinput.BorderSizePixel = 0
  93. vehiclespeedinput.Position = UDim2.new(0.63625592, 0, 0.260465115, 0)
  94. vehiclespeedinput.Size = UDim2.new(0, 200, 0, 50)
  95. vehiclespeedinput.Font = Enum.Font.SourceSansSemibold
  96. vehiclespeedinput.PlaceholderColor3 = Color3.new(0.968628, 0.968628, 0.968628)
  97. vehiclespeedinput.PlaceholderText = "Vehicle Speed [Enter]"
  98. vehiclespeedinput.Text = ""
  99. vehiclespeedinput.TextColor3 = Color3.new(0, 0, 0)
  100. vehiclespeedinput.TextScaled = true
  101. vehiclespeedinput.TextSize = 14
  102. vehiclespeedinput.TextWrapped = true
  103.  
  104. switchvehicle_2.Name = "switchvehicle"
  105. switchvehicle_2.Parent = MainFrame
  106. switchvehicle_2.BackgroundColor3 = Color3.new(0.666667, 0, 1)
  107. switchvehicle_2.BorderSizePixel = 0
  108. switchvehicle_2.Position = UDim2.new(0.106635079, 0, 0.555813968, 0)
  109. switchvehicle_2.Size = UDim2.new(0, 200, 0, 50)
  110. switchvehicle_2.Font = Enum.Font.Highway
  111. switchvehicle_2.Text = "Start"
  112. switchvehicle_2.TextColor3 = Color3.new(0, 0, 0)
  113. switchvehicle_2.TextScaled = true
  114. switchvehicle_2.TextSize = 14
  115. switchvehicle_2.TextWrapped = true
  116.  
  117. exit.Name = "exit"
  118. exit.Parent = MainFrame
  119. exit.BackgroundColor3 = Color3.new(1, 0, 0)
  120. exit.BorderSizePixel = 0
  121. exit.Position = UDim2.new(0.946870446, 0, 0, 0)
  122. exit.Size = UDim2.new(0, 47, 0, 28)
  123. exit.Font = Enum.Font.SourceSansSemibold
  124. exit.Text = "-"
  125. exit.TextColor3 = Color3.new(0, 0, 0)
  126. exit.TextScaled = true
  127. exit.TextSize = 14
  128. exit.TextWrapped = true
  129. exit.MouseButton1Down:Connect(function()
  130. MainFrame.Visible = false
  131. open.Visible = true
  132. end)
  133.  
  134. open.Name = "open"
  135. open.Parent = VehicleSimGui
  136. open.BackgroundColor3 = Color3.new(0, 1, 1)
  137. open.BorderSizePixel = 0
  138. open.Position = UDim2.new(0, 0, 0, mouse.ViewSizeY/2.2)
  139. open.Size = UDim2.new(0, 70, 0, 30)
  140. open.Font = Enum.Font.SourceSansSemibold
  141. open.Text = "Open"
  142. open.TextColor3 = Color3.new(0, 0, 0)
  143. open.TextScaled = true
  144. open.TextSize = 14
  145. open.TextWrapped = true
  146. open.Visible = false
  147. open.MouseButton1Down:Connect(function()
  148. MainFrame.Visible = true
  149. open.Visible = false
  150. end)
  151.  
  152. Credit.Name = "Credit"
  153. Credit.Parent = MainFrame
  154. Credit.BackgroundColor3 = Color3.new(1, 1, 1)
  155. Credit.BackgroundTransparency = 1
  156. Credit.Position = UDim2.new(0.000600961561, 0, 0.97441864, 0)
  157. Credit.Size = UDim2.new(0, 289, 0, 2)
  158. Credit.Font = Enum.Font.SourceSansBold
  159. Credit.Text = "GUI by StevenDahFish"
  160. Credit.TextColor3 = Color3.new(1, 1, 1)
  161. Credit.TextSize = 14
  162. Credit.TextXAlignment = Enum.TextXAlignment.Left
  163.  
  164. Credit2.Name = "Credit2"
  165. Credit2.Parent = MainFrame
  166. Credit2.BackgroundColor3 = Color3.new(1, 1, 1)
  167. Credit2.BackgroundTransparency = 1
  168. Credit2.Position = UDim2.new(0.65625, 0, 0.97441864, 0)
  169. Credit2.Size = UDim2.new(0, 289, 0, 2)
  170. Credit2.Font = Enum.Font.SourceSansBold
  171. Credit2.Text = "Scripting by Victini"
  172. Credit2.TextColor3 = Color3.new(1, 1, 1)
  173. Credit2.TextSize = 14
  174. Credit2.TextXAlignment = Enum.TextXAlignment.Right
  175.  
  176. IntroWait.Name = "IntroWait"
  177. IntroWait.Parent = MainFrame
  178. IntroWait.BackgroundColor3 = Color3.new(1, 1, 1)
  179. IntroWait.Position = UDim2.new(-0.015625, 0, -0.0162790697, 0)
  180. IntroWait.Size = UDim2.new(0, 859, 0, 446)
  181. IntroWait.Style = Enum.FrameStyle.DropShadow
  182.  
  183. TextLabel.Parent = IntroWait
  184. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  185. TextLabel.BackgroundTransparency = 1
  186. TextLabel.Position = UDim2.new(0.0419091955, 0, 0.182735428, 0)
  187. TextLabel.Size = UDim2.new(0, 775, 0, 273)
  188. TextLabel.Font = Enum.Font.SourceSansBold
  189. TextLabel.Text = "Wait for intro to end.."
  190. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  191. TextLabel.TextScaled = true
  192. TextLabel.TextSize = 14
  193. TextLabel.TextWrapped = true
  194.  
  195. IntroFrame.Name = "IntroFrame"
  196. IntroFrame.Parent = VehicleSimGui
  197. IntroFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  198. IntroFrame.BackgroundTransparency = 1
  199. IntroFrame.Position = UDim2.new(0.202954888, 0, 0.275641024, 0)
  200. IntroFrame.Size = UDim2.new(0, 764, 0, 385)
  201.  
  202. Square.Name = "Square"
  203. Square.Parent = IntroFrame
  204. Square.BackgroundColor3 = Color3.new(0.286275, 0.72549, 1)
  205. Square.BorderSizePixel = 0
  206. Square.Position = UDim2.new(0.5, -300, 0.5, 450)
  207. Square.Size = UDim2.new(0, 100, 0, 100)
  208. Square.Font = Enum.Font.SourceSans
  209. Square.Text = ""
  210. Square.TextColor3 = Color3.new(0, 0, 0)
  211. Square.TextSize = 14
  212.  
  213. -- Intro
  214.  
  215. local IntroSong = Instance.new("Sound")
  216. IntroSong.Parent = VehicleSimGui
  217. IntroSong.Volume = 2
  218. IntroSong.SoundId = "rbxassetid://247813691"
  219.  
  220. IntroSong:Play()
  221.  
  222. Square.Visible = true
  223. Square:TweenPosition(UDim2.new(0.5, -300,0.5, -200),'Out','Linear',0.5)
  224. wait(1)
  225. Square:TweenPosition(UDim2.new(0.5, 300,0.5, -200),'Out','Linear',1)
  226. wait(2)
  227. Square:TweenPosition(UDim2.new(0.5, 300,0.5, 200),'Out','Linear',0.6)
  228. wait(1.6)
  229. Square:TweenPosition(UDim2.new(0.5, -300,0.5, 200),'Out','Linear',0.6)
  230. wait(2)
  231. Square:TweenPosition(UDim2.new(0.5, 340,0.5, -207),'Out','Linear',0.5)
  232. wait(1.8)
  233. Square.Size = UDim2.new(0, 844,0, 430)
  234. Square.Position = UDim2.new(0.5, -395,0.5, -206)
  235. wait(2)
  236. Square.Visible = false
  237. MainFrame.Visible = true
  238. wait(3)
  239.  
  240. IntroSong.Volume = IntroSong.Volume - 0.1
  241. wait(0.1)
  242. IntroSong.Volume = IntroSong.Volume - 0.1
  243. wait(0.1)
  244. IntroSong.Volume = IntroSong.Volume - 0.1
  245. wait(0.1)
  246. IntroSong.Volume = IntroSong.Volume - 0.1
  247. wait(0.1)
  248. IntroSong.Volume = IntroSong.Volume - 0.1
  249. wait(0.1)
  250. IntroSong.Volume = IntroSong.Volume - 0.1
  251. wait(0.1)
  252. IntroSong.Volume = IntroSong.Volume - 0.1
  253. wait(0.1)
  254. IntroSong.Volume = IntroSong.Volume - 0.1
  255. wait(0.1)
  256. IntroSong.Volume = IntroSong.Volume - 0.1
  257. wait(0.1)
  258. IntroSong.Volume = IntroSong.Volume - 0.1
  259. wait(0.1)
  260. IntroSong.Volume = IntroSong.Volume - 0.1
  261. wait(0.1)
  262. IntroSong.Volume = IntroSong.Volume - 0.1
  263. wait(0.1)
  264. IntroSong.Volume = IntroSong.Volume - 0.1
  265. wait(0.1)
  266. IntroSong.Volume = IntroSong.Volume - 0.1
  267. wait(0.1)
  268. IntroSong.Volume = IntroSong.Volume - 0.1
  269. wait(0.1)
  270. IntroSong.Volume = IntroSong.Volume - 0.1
  271. wait(0.1)
  272. IntroSong.Volume = IntroSong.Volume - 0.1
  273. wait(0.1)
  274. IntroSong.Volume = IntroSong.Volume - 0.1
  275. wait(0.1)
  276. IntroSong.Volume = IntroSong.Volume - 0.1
  277. wait(0.1)
  278. IntroSong.Volume = IntroSong.Volume - 0.1
  279. wait(0.1)
  280. IntroSong:Remove()
  281. IntroWait:Remove()
  282.  
  283. -- Scripts
  284. -- now victini this is your part <3
  285. function getcar()
  286.  
  287. for i, v in pairs(game.Workspace.Vehicles:GetChildren()) do
  288. if v:IsA("Model") then
  289. for a, b in pairs(v:GetChildren()) do
  290. if b.Name == "owner" then
  291. if b.Value == game.Players.LocalPlayer.Name then
  292. car = v
  293. break
  294. end
  295. end
  296. end
  297. end
  298. end
  299.  
  300. end
  301.  
  302. function getspeed()
  303. me = game.Players.LocalPlayer
  304. cargui = me.PlayerGui.CarGui.Speedometer.Speed
  305. speed = cargui.Text
  306. if speed >= currentspeed then
  307. --false--
  308. car.Bodykit.CenterOfMass.Nitro.Force = Vector3.new(0, 0, 0)
  309. else
  310. --true--
  311. car.Bodykit.CenterOfMass.Nitro.Force = Vector3.new(0, -150250, 0)
  312.  
  313. end
  314. end
  315.  
  316. function ON()
  317. if car ~= nil then
  318. a = true
  319. car:SetPrimaryPartCFrame(CFrame.new(90.6, 59, 898.8))
  320. car.Bodykit.CenterOfMass.Nitro.Force = Vector3.new(0, -150250, 0)
  321. while a == true do
  322. wait(0.25)
  323. getspeed()
  324. car:SetPrimaryPartCFrame(CFrame.new(90.6, 59, 898.8))
  325. wait(0.25)
  326. car:SetPrimaryPartCFrame(CFrame.new(90.6, 59, 898.8))
  327. wait(0.25)
  328. car:SetPrimaryPartCFrame(CFrame.new(90.6, 59, 898.8))
  329. end
  330. end
  331. end
  332.  
  333. function OFF()
  334. car.Bodykit.CenterOfMass.Nitro.Force = Vector3.new(0, 0, 0)
  335. a = false
  336. end
  337.  
  338. function chspeed(speed)
  339. currentspeed = speed
  340. end
  341.  
  342. switchvehicle.MouseButton1Down:connect(function()
  343. getcar()
  344. end)
  345.  
  346. changespeed.MouseButton1Down:connect(function()
  347. chspeed(vehiclespeedinput.Text)
  348. end)
  349.  
  350. switchvehicle_2.MouseButton1Down:connect(function()
  351. if switchvehicle_2.Text == "Start" then
  352. switchvehicle_2.Text = "Stop"
  353. ON()
  354. else
  355. switchvehicle_2.Text = "Start"
  356. OFF()
  357. end
  358. end)
Advertisement
Add Comment
Please, Sign In to add comment