Sacki

time machin really working script

Sep 26th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.15 KB | None | 0 0
  1. local modelname="DeLoreanTimeMachine"
  2. pcall(function() workspace.Base.CFrame=CFrame.new(0,-2,0) end)
  3. print(modelname.."_LOADED")
  4. local plr=game:service("Players")["SBDestroy"]
  5. local char=plr.Character
  6. local T=char.Torso
  7. local c=function(f) coroutine.resume(coroutine.create(f)) end
  8. local pc=pcall
  9. pc(function() workspace:findFirstChild(modelname):remove() end)
  10. local mouse=nil
  11. local pi=math.pi
  12. local rd=math.rad
  13. local sn=math.sin
  14. local cs=math.cos
  15. local rn=math.random
  16. local ti=table.insert
  17. local tr=table.remove
  18. local inf=math.huge
  19. local cn=CFrame.new
  20. local vc=Vector3.new
  21. local ca=CFrame.Angles
  22. local delorean=Instance.new("Model", workspace) delorean.Name=modelname
  23. local screengui=Instance.new("ScreenGui") screengui.Name=modelname
  24. part=function(par, a, c, s, col, t, cf, ms)
  25. local p=Instance.new("Part", par) pcall(function() p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.Size=s p.BrickColor=BrickColor.new(col) p.Transparency=t p.CFrame=cf or cn() end)
  26. local m=Instance.new("BlockMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
  27. return p
  28. end
  29. cylinder=function(par, a, c, s, col, t, cf, ms)
  30. local p=Instance.new("Part", par) pcall(function() p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.Size=s p.BrickColor=BrickColor.new(col) p.Transparency=t p.CFrame=cf or cn() end)
  31. local m=Instance.new("CylinderMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
  32. return p
  33. end
  34. wedge=function(par, a, c, s, col, t, cf, ms)
  35. local p=Instance.new("Part", par) pcall(function() p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.Size=s p.BrickColor=BrickColor.new(col) p.Transparency=t p.CFrame=cf or cn() end)
  36. local m=Instance.new("SpecialMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) m.MeshType="Wedge" end)
  37. return p
  38. end
  39. gui=function(ins, par, bc, bg, tc, fs, text, t, s, pos)
  40. local g=Instance.new(ins, par) g.BorderColor=BrickColor.new(bc) g.BackgroundColor=BrickColor.new(bg) g.TextColor=BrickColor.new(tc) g.FontSize=fs g.Font="ArialBold" g.Text=text g.BackgroundTransparency=t g.Size=s g.Position=pos
  41. return g
  42. end
  43. weld=function(par, p1, cf)
  44. local w=Instance.new("Weld", par) pcall(function() w.Part0=w.Parent or par w.Part1=p1 w.C1=cf or cn() end)
  45. return w
  46. end
  47. mesh=function(ins, par, s, t, id, tid, of)
  48. pcall(function() for i, v in pairs(par:children()) do if v:isA("BlockMesh") or v:isA("CylinderMesh") or v:isA("SpecialMesh") then v:remove() end end end)
  49. local m=Instance.new(ins, par) pcall(function() m.Scale=s or Vector3.new(1, 1, 1) m.Offset=of or Vector3.new() m.MeshId=id or "" m.TextureId=tid or "" m.MeshType=t end)
  50. return m
  51. end
  52. sound=function(parent, id, pitch, volume)
  53. local s=Instance.new("Sound", parent) pcall(function() s.SoundId=id s.Volume=volume or 1 s.Pitch=pitch or 1 end)
  54. return s
  55. end
  56.  
  57. function stick(from, to)
  58. local stickW=weld(from, to, to.CFrame:inverse()*from.CFrame)
  59. stickW.C0=from.CFrame:inverse()*from.CFrame
  60. return stickW
  61. end
  62. bp=Instance.new("BodyPosition") bp.D=200 bp.maxForce=vc(inf,inf,inf)
  63. base=part(delorean, false, true, vc(5, .5, 14), "Really black", 0, cn(0, 200, 0))
  64. wait()
  65. bp.Parent=base
  66. bp.position=(T.CFrame+T.CFrame.lookVector*20).p
  67. base.Name="BASE"
  68. bc=part(delorean, false, true, vc(7, .5, 6), "Really black")
  69. bcw=weld(bc, base, cn())
  70. bf=part(delorean, false, true, vc(7, .5, 2), "Really black")
  71. bfw=weld(bf, base, cn(0, 0, -7))
  72. local bb=part(delorean, false, true, vc(7, .5, 2), "Really black")
  73. local bbw=weld(bb, base, cn(0, 0, 7))
  74. local bf2=part(delorean, false, true, vc(6.8, 1, 1.5), "Really black")
  75. local bf2w=weld(bf2, bf, cn(0, .5, 0))
  76. local bc2=part(delorean, false, true, vc(5, 1, 5), "Really black")
  77. local bc2w=weld(bc2, base, cn(0, .75, -4.5))
  78. local bf3=part(delorean, false, true, vc(7, .5, 3), "Really black")
  79. local bf3w=weld(bf3, bf2, cn(0, .5, -.5))
  80. local enginesmoke=cylinder(delorean, false, true, vc(.5, 2, .5), "Dark stone grey")
  81. local enginesmokew=weld(enginesmoke, bb, cn(2, 0, .75)*ca(-rd(90), 0, 0))
  82. local enginesmoke=cylinder(delorean, false, true, vc(.5, 2, .5), "Dark stone grey")
  83. local enginesmokew=weld(enginesmoke, bb, cn(-2, 0, .75)*ca(-rd(90), 0, 0))
  84.  
  85. local bf4=part(delorean, false, true, vc(7, .7, 3.5), "Mid gray")
  86. local bf4w=weld(bf4, bf3, cn(0, .6, .75))
  87. local bf5=part(delorean, false, true, vc(6, .7, 3), "Mid gray")
  88. local bf5w=weld(bf5, bf4, cn(0, 0, 3))
  89.  
  90. local mprt=part(delorean, false, true, vc(7, 1, .5), "Medium stone grey", 0, cn(), vc(1, .1, 1))
  91. local mprtw=weld(mprt, bf4, cn(0, -.3, -2))
  92. local mprt=part(delorean, false, true, vc(7, 1, .35), "Medium stone grey", 0, cn(), vc(1, .1, 1))
  93. local mprtw=weld(mprt, bf4, cn(0, .3, -1.9))
  94. local mprt=part(delorean, false, true, vc(.2, .65, .5), "Medium stone grey", 0, cn(), vc(1, 1, 1))
  95. local mprtw=weld(mprt, bf4, cn(3.4, -.03, -1.9)*ca(rd(15), 0, 0))
  96. local mprt=part(delorean, false, true, vc(.2, .65, .5), "Medium stone grey", 0, cn(), vc(1, 1, 1))
  97. local mprtw=weld(mprt, bf4, cn(-3.4, -.03, -1.9)*ca(rd(15), 0, 0))
  98. local dmc=part(delorean, false, true, vc(2, .65, .5), "Really black", 0, cn(), vc(1, 1, 1))
  99. local dmcw=weld(dmc, bf4, cn(0, -.03, -1.9)*ca(rd(15), 0, 0))
  100. decal=Instance.new("Decal", dmc)
  101. decal.Texture="http://www.roblox.com/asset/?id=28924870"
  102. decal.Face="Front"
  103. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  104. local prtw=weld(prt, bc, cn(3.25, 1.25, -2.5)*ca(0, 0, 0))
  105. local w=wedge(delorean, false, false, vc(.5, 1, .5), "Mid gray")
  106. local w2=weld(w, prt, cn(0, -.5, .75)*ca(0,pi,0))
  107. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  108. local prtw=weld(prt, bc, cn(3.25, 1.25, -3)*ca(rd(-45), 0, 0))
  109.  
  110. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  111. local prtw=weld(prt, bc, cn(-3.25, 1.25, -2.5)*ca(0, 0, 0))
  112. local w=wedge(delorean, false, false, vc(.5, 1, .5), "Mid gray")
  113. local w2=weld(w, prt, cn(0, -.5, .75)*ca(0,pi,0))
  114. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  115. local prtw=weld(prt, bc, cn(-3.25, 1.25, -3)*ca(rd(-45), 0, 0))
  116.  
  117. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  118. local prtw=weld(prt, bc, cn(3.25, 1.25, 2.5)*ca(0, 0, 0))
  119. local prt2=part(delorean, false, true, vc(.5, 2.2, 1.5), "Mid gray")
  120. local prt2w=weld(prt2, prt, cn(-.25, 1.85, .25)*ca(0, 0, rd(10)))
  121. local w=wedge(delorean, false, false, vc(.5, 2, 1), "Mid gray")
  122. local w2=weld(w, prt, cn(0, 0, -1))
  123. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  124. local prtw=weld(prt, bc, cn(3.25, 1.25, 3)*ca(rd(45), 0, 0))
  125.  
  126. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  127. local prtw=weld(prt, bc, cn(-3.25, 1.25, 2.5)*ca(0, 0, 0))
  128. local prt2=part(delorean, false, true, vc(.5, 2.2, 1.5), "Mid gray")
  129. local prt2w=weld(prt2, prt, cn(.25, 1.85, .25)*ca(0, 0, rd(-10)))
  130. local w=wedge(delorean, false, false, vc(.5, 2, 1), "Mid gray")
  131. local w2=weld(w, prt, cn(0, 0, -1))
  132. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  133. local prtw=weld(prt, bc, cn(-3.25, 1.25, 3)*ca(rd(45), 0, 0))
  134. local main=part(delorean, false, true, vc(6, .5, 1.5), "Mid gray")
  135. local mainw=weld(main, base, cn(0, 4, 2.75))
  136. local stand=part(delorean, false, true, vc(.5, .5, 5.5), "Mid gray")
  137. local standw=weld(stand, base, cn(3,3,5.5)*ca(rd(22),rd(5),0))
  138. local stand=part(delorean, false, true, vc(.5, .5, 5.5), "Mid gray")
  139. local standw=weld(stand, base, cn(-3,3,5.5)*ca(rd(22),rd(-5),0))
  140. local backprt=part(delorean, false, true, vc(6, 2, .5), "Black")
  141. local backprt=weld(backprt, base, cn(0, 3, 2))
  142.  
  143. local window=part(delorean, false, true, vc(5, 2.5, .25), "Black", .5)
  144. local windoww=weld(window, base, cn(0, 3, -1.25)*ca(rd(45), 0, 0))
  145. local border=part(delorean, false, false, vc(5, .5, .5), "Really black")
  146. local borderw=weld(border, window, cn(0, 1.5, 0))
  147. local border=part(delorean, false, false, vc(.5, 3, .5), "Really black")
  148. local borderw=weld(border, window, cn(2.5, 0, 0)*ca(0, 0, rd(10)))
  149. local border=part(delorean, false, false, vc(.5, 3, .5), "Really black")
  150. local borderw=weld(border, window, cn(-2.5, 0, 0)*ca(0, 0, rd(-10)))
  151. local prt=weld()
  152. local mainjoint=part(delorean, false, true, vc(2, .5, 2), "Mid gray")
  153. local mainjointw=weld(mainjoint, base, cn(0, 4, 1))
  154.  
  155. local seat=part(delorean, false, false, vc(2, .5, 2), "Black")
  156. local seatw=weld(seat, base, cn(1.5, .25, 1))
  157. local backseat=part(delorean, false, false, vc(2, 2, .5), "Black")
  158. local backseatw=weld(backseat, seat, cn(0, 1, 1)*ca(rd(10), 0, 0))
  159. local headseat=part(delorean, false, false, vc(1.5, 1.25, .5), "Black")
  160. local headseatw=weld(headseat, seat, cn(0, 2.5, 1.15))
  161. local seat=part(delorean, false, false, vc(2, .5, 2), "Black")
  162. local seatw=weld(seat, base, cn(-1.5, .25, 1))
  163. local backseat=part(delorean, false, false, vc(2, 2, .5), "Black")
  164. local backseatw=weld(backseat, seat, cn(0, 1, 1)*ca(rd(10), 0, 0))
  165. local headseat=part(delorean, false, false, vc(1.5, 1.25, .5), "Black")
  166. local headseatw=weld(headseat, seat, cn(0, 2.5, 1.15))
  167. local line=part(delorean, false, false, vc(1, 1, 14), "Black")
  168. local linew=weld(line, base, cn(0, .5, 0))
  169.  
  170. local back=part(delorean, false, true, vc(5, 1.5, 6), "Mid gray")
  171. local backw=weld(back, base, cn(0, 1, 5))
  172. local bb33s=part(delorean, false, true, vc(7, 1.5, 2), "Mid gray")
  173. local bb33sw=weld(bb33s, base, cn(0, 1, 7))
  174. local bbs=part(delorean, false, true, vc(7, .5, 1), "Really black")
  175. local bbsw=weld(bbs, base, cn(0, .25, 8.25)*ca(-rd(35), 0, 0))
  176. local bbs=part(delorean, false, true, vc(7, 1.5, .5), "Really black")
  177. local bbsw=weld(bbs, base, cn(0, 1, 8.25))
  178. local bb3s=part(delorean, false, true, vc(7, .5, .5), "Medium stone grey")
  179. local bb3sw=weld(bb3s, bb33s, cn(0, 1, 1.25))
  180. local bb3s=part(delorean, false, true, vc(7, .5, 6), "Mid gray")
  181. local bb3sw=weld(bb3s, bb33s, cn(0, 1, -2))
  182. decal=Instance.new("Decal", bb3s)
  183. decal.Texture="http://www.roblox.com/asset/?id=27893351"
  184. decal.Face="Top"
  185. rocket=wedge(delorean, false, true, vc(2,2,4), "Black")
  186. rocketw=weld(rocket, bb3s, cn(2,1,1.5))
  187. r2=wedge(delorean, false, true, vc(2,1,2), "Really black")
  188. r2w=weld(r2,rocket,cn(0,0,2.5)*ca(pi/2,pi,0))
  189. rocket=wedge(delorean, false, true, vc(2,2,4), "Black")
  190. rocketw=weld(rocket, bb3s, cn(-2,1,1.5))
  191. r2=wedge(delorean, false, true, vc(2,1,2), "Really black")
  192. r2w=weld(r2,rocket,cn(0,0,2.5)*ca(pi/2,pi,0))
  193. pp=part(delorean, false, true, vc(2,1,5), "Black")
  194. ppw=weld(pp,bb3s,cn(0,.5,0))
  195. reactor=part(delorean, false, true, vc(2,1.5,2), "Dark stone grey")
  196. reactorw=weld(reactor,pp,cn(0,-.25,1.5))
  197. reactorm=mesh("SpecialMesh", reactor, vc(.4,.1,.4), "FileMesh", "http://www.roblox.com/Asset/?id=10207677")
  198. cyl=cylinder(delorean,false,true,vc(.8,1.5,.8),"White")
  199. cylw=weld(cyl,reactor,cn(0,1.5,0))
  200. decal=Instance.new("Decal", cyl)
  201. decal.Texture="http://www.roblox.com/asset/?id=37389443"
  202. decal.Face="Front"
  203. decal=Instance.new("Decal", cyl)
  204. decal.Texture="http://www.roblox.com/asset/?id=37389443"
  205. decal.Face="Back"
  206. decal=Instance.new("Decal", cyl)
  207. decal.Texture="http://www.roblox.com/asset/?id=37389443"
  208. decal.Face="Right"
  209. decal=Instance.new("Decal", cyl)
  210. decal.Texture="http://www.roblox.com/asset/?id=37389319"
  211. decal.Face="Left"
  212.  
  213. cyl2=cylinder(delorean,false,true,vc(.5,.5,.5),"Really black")
  214. cyl2w=weld(cyl2,cyl,cn(0,.75,0))
  215. but=part(delorean,false,true,vc(.4,.3,1),"Bright red")
  216. butw=weld(but,cyl,cn(0,-.5,.5))
  217.  
  218. local wed=wedge(delorean, false, true, vc(7, .5, 3), "Mid gray")
  219. local wedw=weld(wed, bf2, cn(0, 0, -.5)*ca(0, 0, pi))
  220. local trunk=wedge(delorean, false, true, vc(7, .5, 6.35), "Mid gray")
  221. local trunkw=weld(trunk, bf4, cn(0, .6, 1.5))
  222.  
  223. --TIRE
  224. local prts=6
  225. local rad=1.6
  226. local tfr=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Black")
  227. local tfrw=weld(tfr, base, cn(3,.25,-4.5)*ca(0,0,pi/2))
  228. local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Mid gray")
  229. local metw=weld(met, tfr, cn())
  230. for i=0,pi,pi/prts do
  231. local p=part(delorean, false, false, vc(1.1,1.1,.5), "Mid gray")
  232. p.CFrame=tfr.CFrame*cn(rad*sn(i), 0, rad*cs(i))
  233. p.CFrame=CFrame.new(p.CFrame.p, tfr.CFrame.p)
  234. stick(p, base)
  235. end
  236.  
  237. local tfl=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Black")
  238. local tflw=weld(tfl, base, cn(-3,.25,-4.5)*ca(0,0,pi/2))
  239. local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Mid gray")
  240. local metw=weld(met, tfl, cn())
  241. for i=0,pi,pi/prts do
  242. local p=part(delorean, false, false, vc(1.1,1.1,.5), "Mid gray")
  243. p.CFrame=tfl.CFrame*cn(rad*sn(i), 0, rad*cs(i))
  244. p.CFrame=CFrame.new(p.CFrame.p, tfl.CFrame.p)
  245. stick(p, base)
  246. end
  247.  
  248. local tbr=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Black")
  249. local tbrw=weld(tbr, base, cn(3,.25,4.5)*ca(0,0,pi/2))
  250. local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Mid gray")
  251. local metw=weld(met, tbr, cn())
  252. for i=0,pi,pi/prts do
  253. local p=part(delorean, false, false, vc(1.1,1.1,.5), "Mid gray")
  254. p.CFrame=tbr.CFrame*cn(rad*sn(i), 0, rad*cs(i))
  255. p.CFrame=CFrame.new(p.CFrame.p, tbr.CFrame.p)
  256. stick(p, base)
  257. end
  258.  
  259. local tbl=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Black")
  260. local tblw=weld(tbl, base, cn(-3,.25,4.5)*ca(0,0,pi/2))
  261. local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Mid gray")
  262. local metw=weld(met, tbl, cn())
  263. for i=0,pi,pi/prts do
  264. local p=part(delorean, false, false, vc(1.1,1.1,.5), "Mid gray")
  265. p.CFrame=tbl.CFrame*cn(rad*sn(i), 0, rad*cs(i))
  266. p.CFrame=CFrame.new(p.CFrame.p, tbl.CFrame.p)
  267. stick(p, base)
  268. end
  269. atfr=function(cf)
  270. tfrw.C1=cn(3,.25,-4.5)*ca(0,0,pi/2)*cf
  271. end
  272. atfl=function(cf)
  273. tflw.C1=cn(-3,.25,-4.5)*ca(0,0,pi/2)*cf
  274. end
  275. atbr=function(cf)
  276. tblw.C1=cn(3,.25,4.5)*ca(0,0,pi/2)*cf
  277. end
  278. atbl=function(cf)
  279. tblw.C1=cn(-3,.25,4.5)*ca(0,0,pi/2)*cf
  280. end
  281. local trunkw=weld(trunk, bf4, cn(0, .6, 1.25))
  282. --SEATS
  283. --DOOR
  284. local DoorRight=Instance.new("Model", delorean)
  285. local djr=part(DoorRight, false, false, vc(1, 1, 1), "Mid gray", 1)
  286. local djrw=weld(djr, mainjoint, cn(1,0,0)*ca(0,0,0))
  287. local dp=part(DoorRight, false, true, vc(2, .5, 2), "Mid gray")
  288. local dpw=weld(dp, djr, cn(1, 0, 0))
  289. local dp2=part(DoorRight, false, true, vc(.5, .5, 3.25), "Mid gray")
  290. local dp2w=weld(dp2, dp, cn(1, -1, -2)*ca(rd(-45),rd(-10),0))
  291. local dp3=part(DoorRight, false, true, vc(.5, 2.2, .5), "Mid gray")
  292. local dp3w=weld(dp3, dp, cn(1, -.85, .75)*ca(0, 0, rd(15)))
  293. local dw=wedge(DoorRight, false, true, vc(.5, 2, 1), "Mid gray")
  294. local dww=weld(dw, dp, cn(1.25, -2.75, .5)*ca(pi,0,0))
  295. local dw=wedge(DoorRight, false, true, vc(.5,1,.5), "Mid gray")
  296. local dww=weld(dw, dp, cn(1.25, -3.25, -2.75)*ca(pi, pi, 0))
  297. local dp4=part(DoorRight, false, true, vc(.5,1,.5), "Mid gray")
  298. local dp4w=weld(dp4, dp, cn(1.25, -2.25, -2.75))
  299. local dp5=part(DoorRight, false, true, vc(.5,2,2.5), "Mid gray")
  300. local dp5w=weld(dp5, dp, cn(1.25, -2.75, -1.25))
  301. local dwindow=wedge(DoorRight, false, true, vc(.25, 2, 2), "Really black", .5)
  302. local dwindoww=weld(dwindow, dp, cn(1, -1, -1.75)*ca(0, 0, rd(15)))
  303. local dwindow=part(DoorRight, false, true, vc(.25, 2, 1.5), "Really black", .5)
  304. local dwindoww=weld(dwindow, dp, cn(1, -1, 0)*ca(0, 0, rd(15)))
  305. local glass=part(DoorRight, false, true, vc(1, .5, .2), "Really black")
  306. local glassw=weld(glass, dp, cn(1.5, -1.5, -2)*ca(0, rd(-35), 0))
  307.  
  308. local actr=false
  309. local debr=false
  310. function clickr()
  311. if actr==false then
  312. if debr==false then
  313. debr=true
  314. for i=0, 1, .1 do
  315. djrw.C1=cn(1,0,0)*ca(0,0,rd(90)*i)
  316. wait()
  317. end
  318. debr=false
  319. actr=true
  320. end
  321. elseif actr==true then
  322. if debr==false then
  323. debr=true
  324. for i=1, 0, -.1 do
  325. djrw.C1=cn(1,0,0)*ca(0,0,rd(90)*i)
  326. wait()
  327. end
  328. debr=false
  329. actr=false
  330. end
  331. end
  332. end
  333.  
  334. for i, v in pairs(DoorRight:children()) do
  335. local cdetector=Instance.new("ClickDetector", v)
  336. cdetector.MouseClick:connect(clickr)
  337. end
  338.  
  339. local DoorLeft=Instance.new("Model", delorean)
  340. local djl=part(DoorLeft, false, false, vc(1, 1, 1), "Mid gray", 1)
  341. local djlw=weld(djl, mainjoint, cn(-1,0,0))
  342. local dp=part(DoorLeft, false, true, vc(2, .5, 2), "Mid gray")
  343. local dpw=weld(dp, djl, cn(-1, 0, 0))
  344. local dp2=part(DoorLeft, false, true, vc(.5, .5, 3.25), "Mid gray")
  345. local dp2w=weld(dp2, dp, cn(-1, -1, -2)*ca(rd(-45),rd(10),0))
  346. local dp3=part(DoorLeft, false, true, vc(.5, 2.2, .5), "Mid gray")
  347. local dp3w=weld(dp3, dp, cn(-1, -.85, .75)*ca(0, 0, rd(-15)))
  348. local dw=wedge(DoorLeft, false, true, vc(.5, 2, 1), "Mid gray")
  349. local dww=weld(dw, dp, cn(-1.25, -2.75, .5)*ca(pi,0,0))
  350. local dw=wedge(DoorLeft, false, true, vc(.5,1,.5), "Mid gray")
  351. local dww=weld(dw, dp, cn(-1.25, -3.25, -2.75)*ca(pi, pi, 0))
  352. local dp4=part(DoorLeft, false, true, vc(.5,1,.5), "Mid gray")
  353. local dp4w=weld(dp4, dp, cn(-1.25, -2.25, -2.75))
  354. local dp5=part(DoorLeft, false, true, vc(.5,2,2.5), "Mid gray")
  355. local dp5w=weld(dp5, dp, cn(-1.25, -2.75, -1.25))
  356. local dwindow=wedge(DoorLeft, false, true, vc(.25, 2, 2), "Really black", .5)
  357. local dwindoww=weld(dwindow, dp, cn(-1, -1, -1.75)*ca(0, 0, rd(-15)))
  358. local dwindow=part(DoorLeft, false, true, vc(.25, 2, 1.5), "Really black", .5)
  359. local dwindoww=weld(dwindow, dp, cn(-1, -1, 0)*ca(0, 0, rd(-15)))
  360. local glass=part(DoorLeft, false, true, vc(1, .5, .2), "Really black")
  361. local glassw=weld(glass, dp, cn(-1.5, -1.5, -2)*ca(0, rd(35), 0))
  362.  
  363. local actl=false
  364. local debl=false
  365. function clickl()
  366. if actl==false then
  367. if debl==false then
  368. debl=true
  369. for i=0, 1, .1 do
  370. djlw.C1=cn(-1,0,0)*ca(0,0,rd(-90)*i)
  371. wait()
  372. end
  373. debl=false
  374. actl=true
  375. end
  376. elseif actl==true then
  377. if debl==false then
  378. debl=true
  379. for i=1, 0, -.1 do
  380. djlw.C1=cn(-1,0,0)*ca(0,0,rd(-90)*i)
  381. wait()
  382. end
  383. debl=false
  384. actl=false
  385. end
  386. end
  387. end
  388.  
  389. for i, v in pairs(DoorLeft:children()) do
  390. local cdetector=Instance.new("ClickDetector", v)
  391. cdetector.MouseClick:connect(clickl)
  392. end
  393.  
  394. local bf=Instance.new("BodyForce")
  395. local bav=Instance.new("BodyAngularVelocity") bav.angularvelocity=vc(0,0,0) bav.maxTorque=vc(math.huge,math.huge,math.huge)
  396. local vs=Instance.new("VehicleSeat", delorean)
  397. vs.HeadsUpDisplay=false
  398. vs.CanCollide=false
  399. vs.Transparency=1
  400. vs.Size=Vector3.new(2, .5, 2)
  401. weld(vs, base, cn(-1.5, 0, 1))
  402. local ps=Instance.new("VehicleSeat", delorean)
  403. ps.HeadsUpDisplay=false
  404. ps.CanCollide=false
  405. ps.Size=Vector3.new(2, .5, 2)
  406. ps.Transparency=1
  407. weld(ps, base, cn(1.5, 0, 1))
  408. torsos={}
  409. ps.ChildAdded:connect(function(w)
  410. if w.Name=="SeatWeld" then
  411. torso=w.Part1
  412. if torso then
  413. for i, v2 in pairs(torso.Parent:children()) do
  414. if v2:isA("BasePart") then
  415. for i, v3 in pairs(v2:children()) do
  416. if v3:isA("CFrameValue") then
  417. v3:remove()
  418. end
  419. end
  420. end
  421. end
  422. end
  423. table.insert(torsos, torso)
  424. w.C1=w.C1*CFrame.new(0, 0, .5)
  425. end
  426. end)
  427. running=false
  428. vs.ChildAdded:connect(function(w)
  429. if w.Name=="SeatWeld" then
  430. torso=w.Part1
  431. w.C1=w.C1*CFrame.new(0, 0, .5)
  432. if torso then
  433. for i, v2 in pairs(torso.Parent:children()) do
  434. if v2:isA("BasePart") then
  435. for i, v3 in pairs(v2:children()) do
  436. if v3:isA("CFrameValue") then
  437. v3:remove()
  438. end
  439. end
  440. end
  441. end
  442. table.insert(torsos, torso)
  443. local player=game.Players:getPlayerFromCharacter(torso.Parent)
  444. screengui=Instance.new("ScreenGui", player.PlayerGui) screengui.Name=modelname
  445. speedometer=gui("TextLabel", screengui, "Black", "Black", "Really black", "Size48", "0", 1, UDim2.new(0, 100, 0, 100), UDim2.new(0, 50, .85, 0))
  446. hourlabel=gui("TextLabel", screengui, "Black", "Black", "Really black", "Size48", "HH", 1, UDim2.new(0, 100, 0, 50), UDim2.new(.7, 0, .8, 0))
  447. minutelabel=gui("TextLabel", hourlabel, "Black", "Black", "Really black", "Size48", "MM", 1, UDim2.new(1, 0, 1, 0), UDim2.new(1, 0, 0, 0))
  448. secondlabel=gui("TextLabel", minutelabel, "Black", "Black", "Really black", "Size48", "SS", 1, UDim2.new(1, 0, 1, 0), UDim2.new(1, 0, 0, 0))
  449. hourbox=gui("TextBox", hourlabel, "Black", "Black", "Really red", "Size48", "24", 1, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  450. minutebox=gui("TextBox", minutelabel, "Black", "Black", "Really red", "Size48", "00", 1, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  451. secondbox=gui("TextBox", secondlabel, "Black", "Black", "Really red", "Size48", "00", 1, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  452. running=true
  453. run()
  454. end
  455. end
  456. end)
  457. vs.ChildRemoved:connect(function(w)
  458. if w.Name=="SeatWeld" then
  459. torso=w.Part1
  460. if torso then
  461. for i, v in pairs(torsos) do
  462. if v==torso then
  463. table.remove(torsos,i)
  464. end
  465. end
  466. local player=game.Players:getPlayerFromCharacter(torso.Parent)
  467. player.PlayerGui[modelname]:remove()
  468. running=false
  469. end
  470. end
  471. end)
  472. ps.ChildRemoved:connect(function(w)
  473. if w.Name=="SeatWeld" then
  474. torso=w.Part1
  475. if torso then
  476. for i, v in pairs(torsos) do
  477. if v==torso then
  478. table.remove(torsos,i)
  479. end
  480. end
  481. end
  482. end
  483. end)
  484. c(function()wait(.5) bp:remove()end)
  485. function makelightning(from, to, thick, col)
  486. local magnitude=(from.p-to.p).magnitude
  487. local distance=(from.p+to.p)/2
  488. local pattern=part(workspace, true, false, vc(.2, .2, magnitude), "White", 1, cn(distance, from.p))
  489. local fromPosProx=from.p
  490. for i=1, 4 do
  491. local fromPosProx2=fromPosProx
  492. local random=vc(rn(-1, 1), rn(-1, 1), rn(-1, 1))
  493. local findSize=pattern.Size.z/3
  494. local findOffSet=pattern.CFrame.lookVector*-1
  495. local compute=i*findSize*findOffSet
  496. local newfromPos=from.p
  497. local newEndPos=cn(random+compute+newfromPos).p
  498. local magnitude=(fromPosProx2-newEndPos).magnitude
  499. local distance=(fromPosProx2+newEndPos)/2
  500. local lightning=part(workspace, true, false, vc(1, 1, 1), col or "Bright yellow", 0, cn(distance, fromPosProx2), vc(thick, thick, magnitude))
  501. fromPosProx=newEndPos
  502. game.Debris:addItem(lightning, .5)
  503. end
  504. pattern:remove()
  505. end
  506. function play(soundid, pitch, volume)
  507. local sound=sound(workspace, soundid, pitch, volume)
  508. sound:play()
  509. c(function() wait(5) sound:remove() end)
  510. end
  511.  
  512.  
  513. trm=Instance.new("Model", delorean)
  514. function trail(prt, cf, thick, col)
  515. local old=(prt.CFrame*(cf or cn())).p
  516. local trail=part(trm, true, false, vc(1, 1, 1), col or "White", 0, cn(old)*ca(rn(-360, 360),rn(-360, 360),rn(-360, 360)), vc(thick, thick, thick))
  517. c(function()
  518. for i=1, 0, -.001 do pc(function() trail.Mesh.Scale=trail.Mesh.Scale*vc(i, i, i) end) wait() end
  519. trail:remove()
  520. end)
  521. end
  522.  
  523. Targets={}
  524. timedeb=false
  525. num=0
  526. maxnum=400
  527. origin=0
  528. function stick(from, to)
  529. local stickW=weld(from, to, to.CFrame:inverse()*from.CFrame)
  530. stickW.C0=from.CFrame:inverse()*from.CFrame
  531. return stickW
  532. end
  533. local bp=Instance.new("BodyPosition") bp.D=100 bp.maxForce=vc(inf,inf,inf)
  534. timedeb=false
  535.  
  536. function run()
  537. num=0
  538. c(function()
  539. for i, v in pairs(workspace:children()) do
  540. if v:isA("Model") then
  541. for i, v2 in pairs(v:children()) do
  542. if v2:isA("BasePart") then
  543. for i, v3 in pairs(v2:children()) do
  544. if v3:isA("CFrameValue") then
  545. v3:remove()
  546. end
  547. end
  548. end
  549. end
  550. end
  551. end
  552. timedeb=true
  553. while true do
  554. --TimeContinium-----------------------------
  555. if num<=0 and timedeb==true then
  556. for i, v in pairs(workspace:children()) do
  557. if v:isA("BasePart") then
  558. if v.Anchored==false then
  559. table.insert(Targets, v)
  560. local Origin = Instance.new("CFrameValue")
  561. Origin.Parent = v
  562. Origin.Name = "Origin CFrame"
  563. Origin.Value = v.CFrame
  564. end
  565. end
  566. for i, t in pairs(torsos) do
  567. if v:isA("Model") and v~=t.Parent and v~=delorean then
  568. for i, v2 in pairs(v:children()) do
  569. if v2:isA("BasePart") then
  570. table.insert(Targets, v2)
  571. local Origin = Instance.new("CFrameValue")
  572. Origin.Parent = v2
  573. Origin.Name = "Origin CFrame"
  574. Origin.Value = v2.CFrame
  575. end
  576. end
  577. end
  578. end
  579. end
  580. ---------
  581. while num<maxnum and timedeb==true do ---print(num)
  582. for i, v in pairs(workspace:children()) do
  583. if v:isA("BasePart") and v:findFirstChild("Origin CFrame")==nil then
  584. if v.Anchored==false then
  585. table.insert(Targets, v)
  586. local Origin = Instance.new("CFrameValue")
  587. Origin.Parent = v
  588. Origin.Name = "Origin CFrame"
  589. Origin.Value = v.CFrame
  590. end
  591. end
  592. for i, t in pairs(torsos) do
  593. if v:isA("Model") and v~=t.Parent and v~=delorean then
  594. for i, v2 in pairs(v:children()) do
  595. if v2:isA("BasePart") and v2:findFirstChild("Origin CFrame")==nil then
  596. table.insert(Targets, v2)
  597. local Origin = Instance.new("CFrameValue")
  598. Origin.Parent = v2
  599. Origin.Name = "Origin CFrame"
  600. Origin.Value = v2.CFrame
  601. end
  602. end
  603. end
  604. end
  605. end
  606. for i, v in pairs(Targets) do
  607. local History = Instance.new("CFrameValue")
  608. History.Parent = v
  609. History.Name = num
  610. History.Value = v.CFrame
  611. end
  612. num = num + 1
  613. wait()
  614. end
  615. end
  616. wait()
  617. end
  618. end)
  619. while running do
  620. local speed=base.Velocity.magnitude
  621. speedometer.Text=math.floor(speed)
  622. if speed>65 and speed<88 then play("http://www.roblox.com/asset/?id=2800815", 1, .5)
  623. makelightning(base.CFrame*CFrame.new(0,0,10), base.CFrame*CFrame.new(rn(-10,10),rn(-10,10),rn(-2,10)), 1)
  624. trail(tbr,cn(-1.5, 0, -10),2.5,"Bright orange")
  625. trail(tbl,cn(-1.9, 0, -10),2.5,"Bright orange")
  626. end
  627. if speed>88 and speed<90 then play("http://roblox.com/asset/?id=10209481")
  628. local trm2=trm:clone() trm2.Parent=workspace
  629. origin=base.Position
  630. print(origin)
  631. game.Debris:addItem(trm2, 5)
  632. bp.position=vc(0,0,-99999)
  633. bp.Parent=base
  634. timedeb=false
  635. c(function()
  636. for i=0,1,.005 do
  637. game.Lighting.TimeOfDay=math.floor(hourbox.Text*i)..":"..math.floor(minutebox.Text*i)..":"..math.floor(secondbox.Text*i)
  638. wait()
  639. end
  640. end)
  641. while num > 0 do --print(num)
  642. wait()
  643. num = num - 1
  644. for i, v in pairs(Targets) do
  645. v.Anchored=true
  646. local History = v:findFirstChild(num)
  647. if History ~= nil then
  648. v.CFrame = History.Value
  649. History:remove()
  650. end
  651. end
  652. end
  653. for i, v in pairs(Targets) do
  654. local Origin = v:findFirstChild("Origin CFrame")
  655. if Origin ~= nil then
  656. v.CFrame = Origin.Value
  657. v:makeJoints()
  658. Origin:remove()
  659. end
  660. end
  661. for i, v in pairs(Targets) do
  662. v.Anchored=false
  663. end
  664. play("http://www.roblox.com/asset/?id=2101148", 1, 1)
  665. exp=Instance.new("Explosion", workspace)
  666. exp.BlastPressure=0
  667. exp.Position=origin
  668. Targets = {}
  669. timedeb=true
  670. bp.position=origin
  671. origin=0
  672. base.Velocity=vc(0,0,0)
  673. bf.force=base.CFrame.lookVector*0
  674. wait(1)
  675. bp:remove()
  676. end
  677. if vs.Steer==0 then bav.angularvelocity=vc(0,0,0) atfr(ca(0, 0, 0)) atfl(ca(0, 0, 0)) end
  678. if vs.Steer==1 then atfr(ca(rd(-25), 0, 0)) atfl(ca(rd(-25), 0, 0)) end
  679. if vs.Steer==-1 then atfr(ca(rd(25), 0, 0)) atfl(ca(rd(25), 0, 0)) end
  680. if vs.Throttle==1 then bav.Parent=base bf.Parent=base
  681. if vs.Steer==1 then bav.angularvelocity=vc(0,-2,0) end
  682. if vs.Steer==-1 then bav.angularvelocity=vc(0,2,0) end
  683. bf.force=base.CFrame.lookVector*40000
  684. end
  685. if vs.Throttle==0 then bav.Parent=base bf.Parent=base
  686. bf.force=base.CFrame.lookVector*0
  687. end
  688. if vs.Throttle==-1 then bav.Parent=base bf.Parent=base
  689. if vs.Steer==1 then bav.angularvelocity=vc(0,2,0) end
  690. if vs.Steer==-1 then bav.angularvelocity=vc(0,-2,0) end
  691. bf.force=base.CFrame.lookVector*-40000
  692. end
  693. wait()
  694. end
  695. end
Add Comment
Please, Sign In to add comment