Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.02 KB | None | 0 0
  1. wait(2)
  2. print("f")
  3. local player = game.Players.LocalPlayer
  4. local char = player.Character
  5. --local f = false
  6. local car = false
  7. local mouse = player:GetMouse()
  8. local selected = workspace.mid
  9. mouse.Button1Down:connect(function()
  10. if car==false then
  11. if mouse.Target.Parent.Name=="twin" then
  12. selected = mouse.Target.Parent.cameraholder.camera
  13. car = true
  14. end
  15. end
  16. end)
  17. while car==false do
  18. wait(0.3)
  19. end
  20. local twin = selected.Parent.Parent
  21. script.fuelusing.Changed:Connect(function()
  22. if script.fuelusing.Value==false then
  23. twin.nitro.stopped:FireServer()
  24. end
  25. if script.fuelusing.Value==true then
  26. twin.nitro:FireServer()
  27. end
  28. end)
  29. mouse.Button2Down:connect(function()
  30. player.PlayerGui.Screen.fuel.using:Fire()
  31. end)
  32. mouse.Button2Up:connect(function()
  33. player.PlayerGui.Screen.fuel.stopped:Fire()
  34. script.fuelusing.Value = false
  35. end)
  36. mouse.KeyDown:connect(function(key)
  37. if key=="f" then
  38. twin.f:FireServer()
  39. end
  40. if key=="w" then
  41. twin.w.on:FireServer()
  42. end
  43. if key=="s" then
  44. twin.s.on:FireServer()
  45. end
  46. if key=="a" then
  47. twin.a.on:FireServer()
  48. end
  49. if key=="d" then
  50. twin.d.on:FireServer()
  51. end
  52. if key=="f" then
  53. --twin.f:FireServer()
  54. end
  55. end)
  56. mouse.KeyUp:connect(function(key)
  57. if key=="f" then
  58. end
  59. if key=="w" then
  60. twin.w.off:FireServer()
  61. end
  62. if key=="s" then
  63. twin.s.off:FireServer()
  64. end
  65. if key=="a" then
  66. twin.a.off:FireServer()
  67. end
  68. if key=="d" then
  69. twin.d.off:FireServer()
  70. end
  71. end)
  72. local finalflip = 0
  73. twin.setflip.OnClientEvent:connect(function(set)
  74. --print(finalflip)
  75. --print("started")
  76. if finalflip>2 then
  77. player.PlayerGui.Screen.flippoints.Visible = true
  78. player.PlayerGui.Screen.flippoints.Text = "Points +"..set
  79. end
  80. finalflip = set
  81. end)
  82. twin.stopflip.OnClientEvent:connect(function()
  83. --print("stopped")
  84. if finalflip>2 then
  85. player.PlayerGui.Screen.addpoints.pointsobject:Fire(finalflip/2)
  86. end
  87. finalflip = 0
  88. player.PlayerGui.Screen.flippoints.Visible = false
  89. player.PlayerGui.Screen.flippoints.Text = "Points +0"
  90. end)
  91. local chill = char:GetChildren()
  92. for i=1,#chill do
  93. if chill[i]:IsA("BasePart") then
  94. chill[i].Transparency = 1
  95. end
  96. end
  97. local RunService = game:GetService("RunService")
  98. local RATE_PER_SECOND = 2
  99. local x = 0
  100. local old
  101. local new
  102. local firstrun = true
  103. local flip = false
  104. RunService.RenderStepped:Connect(function()
  105. --local increment = RATE_PER_SECOND * step
  106. --workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
  107. if flip==true then
  108. flip = false
  109. old = twin.cameraholder.camera.WorldCFrame
  110. else
  111. flip = true
  112. new = twin.cameraholder.camera.WorldCFrame
  113.  
  114. end
  115. if firstrun==true then
  116. workspace.CurrentCamera.CFrame=twin.cameraholder.camera.WorldCFrame
  117. firstrun = false
  118. end
  119. --workspace.CurrentCamera.CFrame=CFrame.new((old.p+new.p)/2,((old.LookVector+old.p)+(new.LookVector+new.p))/2)
  120. --workspace.CurrentCamera.CameraType = Enum.CameraType.Fixed
  121. workspace.CurrentCamera.CameraSubject = twin.cameraholder
  122. workspace.Terrain.render:FireServer()
  123. if twin.Chassis.av.Enabled==true then
  124. local c = Instance.new("Part")
  125. c.Parent = workspace
  126. c.CFrame = twin.Chassis.CFrame
  127. c.Anchored = true
  128. c.CanCollide = false
  129. c.Orientation = twin.Chassis.beforespin.Value
  130. local att = Instance.new("Attachment")
  131. att.Parent = c
  132. att.CFrame = twin.cameraholder.camera.CFrame
  133. local j = att.WorldCFrame
  134. --
  135. c:Destroy()
  136. end
  137. end)
  138.  
  139.  
  140. --script named bodyhandler
  141.  
  142. local twin = script.Parent
  143. script.go.Event:Connect(function()
  144. local hold = twin.bodyhold
  145. hold.CFrame = twin.center.CFrame
  146. hold.Position = twin.center.Position+script.posoffset.Value
  147. twin.body.Mesh.Scale = script.size.Value
  148. twin.body.CFrame = twin.bodyhold.WorldCFrame
  149. end)
  150.  
  151. --script named engine
  152. local ftime = 0
  153. local flimit = 250
  154. local fdiv = 30000
  155. script.cycle.Event:Connect(function()
  156. local twin = script.Parent
  157. local w = twin.w.Value
  158. local s = twin.s.Value
  159. local a = twin.a.Value
  160. local d = twin.d.Value
  161.  
  162.  
  163. local f = 0
  164. local t = 0
  165.  
  166. if w==true and s==false then
  167. f=1
  168. if a==true and d==false then
  169. t=1
  170. end
  171. if a==false and d==true then
  172. t=-1
  173. end
  174. end
  175. if w==false and s==true then
  176. f=-1
  177. if a==true and d==false then
  178. t=-1
  179. end
  180. if a==false and d==true then
  181. t=1
  182. end
  183. end
  184. if w==false and s==false then
  185. f=0
  186. t=0
  187. end
  188. if a==false and d==false then
  189. t=0
  190. end
  191.  
  192. if f==1 and twin.canforward.Value==false then
  193. --f=0
  194. end
  195. if f==-1 and twin.canbackward.Value==false then
  196. --f=0
  197. end
  198.  
  199. local speed = script.Parent.speed.Value
  200. local turnspeed = script.Parent.turnspeed.Value
  201.  
  202. if f==1 then
  203. twin.enginepush.Position = Vector3.new(0,0,-1*((ftime*ftime)/fdiv))
  204. end
  205. if f==-1 then
  206. twin.enginepush.Position = Vector3.new(0,0,-1*((ftime*ftime)/fdiv))
  207. end
  208. if f==0 then
  209. twin.enginepush.Position = Vector3.new(0,0,-1*((ftime*ftime)/fdiv))
  210. end
  211.  
  212. if t==1 then
  213. twin.enginepush.Orientation = Vector3.new(0,0.01*turnspeed,0)
  214. end
  215. if t==-1 then
  216. twin.enginepush.Orientation = Vector3.new(0,-0.01*turnspeed,0)
  217. end
  218. if t==0 then
  219. twin.enginepush.Orientation = Vector3.new(0,0,0)
  220. end
  221.  
  222. if ftime<flimit and f==1 then
  223. ftime=ftime+1
  224. end
  225.  
  226. if f==1 then else
  227. if ftime>4 then
  228. ftime = ftime-4
  229. else
  230. ftime = 0
  231. end
  232. end
  233. end)
  234.  
  235. --script named rotate vh
  236. local twin = script.Parent
  237. script.go.Event:Connect(function(tiltv,tilth,center)
  238. if twin.airbound.Value==false then
  239. local mul = 0.5
  240. if twin.testforblockunder.output.Value==true then
  241. mul = 0.25
  242. end
  243. local v = CFrame.new(center,tiltv)
  244. local h = CFrame.new(center,tilth)
  245. local partv = Instance.new("Part")
  246. partv.CFrame = v
  247. local va = partv.Orientation.X*mul
  248. local parth = Instance.new("Part")
  249. parth.CFrame = h
  250. local ha = parth.Orientation.X*mul
  251. --print(va,ha)
  252. partv:Destroy()
  253. parth:Destroy()
  254. local reversevel = twin.reversevel
  255. local future = twin.future
  256. future.Orientation = Vector3.new(va,0,ha)
  257. twin.combine.Position = (twin.future.Position+twin.enginepush.Position)*mul
  258. twin.combine.Orientation = twin.future.Orientation+(twin.enginepush.Orientation)
  259. reversevel.CFrame = twin.combine.CFrame
  260. --local test = twin.testforcol.go:Fire()
  261.  
  262.  
  263. local detected = false
  264. local c = twin.body:Clone()
  265. c.Mesh:Destroy()
  266. c.Size = c.Size*1.1
  267. twin.placetest.CFrame = twin.combine.CFrame
  268. twin.placetest.Position = Vector3.new(
  269. twin.combine.Position.X,
  270. twin.combine.Position.Y+twin.vehicleYNN.Value.X+2.6,
  271. twin.combine.Position.Z
  272. )
  273. c.CFrame = twin.placetest.WorldCFrame
  274. c.Parent = workspace.ignore
  275. local col = c:GetTouchingParts()
  276. c.Parent = game.Lighting
  277. for i=1,#col do
  278. if col[i].Name=="col" then
  279. detected = true
  280.  
  281. end
  282. end
  283. c:Destroy()
  284.  
  285. -- print(detected)
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301. if detected then else
  302. twin.velocityhandling.record:Fire(
  303. twin.combine.Position.X,
  304. twin.combine.Position.Y,
  305. twin.combine.Position.Z
  306. )
  307. twin.CFrame = twin.combine.WorldCFrame
  308. end
  309. else
  310. twin.velocityhandling.let:Fire()
  311. end
  312. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement