Advertisement
DedFense

(Mine) DeLorean Script

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