Advertisement
ghostteen14

Untitled

Jun 10th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.54 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. :ls local modelname="DeLoreanTimeMachine"
  153. pcall(function() workspace.Base.CFrame=CFrame.new(0,-2,0) end)
  154. print(modelname.."_LOADED")
  155. local plr=game:service("Players")["GRENADESPARTAN3"]
  156. local char=plr.Character
  157. local T=char.Torso
  158. local c=function(f) coroutine.resume(coroutine.create(f)) end
  159. local pc=pcall
  160. pc(function() workspace:findFirstChild(modelname):remove() end)
  161. local mouse=nil
  162. local pi=math.pi
  163. local rd=math.rad
  164. local sn=math.sin
  165. local cs=math.cos
  166. local rn=math.random
  167. local ti=table.insert
  168. local tr=table.remove
  169. local inf=math.huge
  170. local cn=CFrame.new
  171. local vc=Vector3.new
  172. local ca=CFrame.Angles
  173. local delorean=Instance.new("Model", workspace) delorean.Name=modelname
  174. local screengui=Instance.new("ScreenGui") screengui.Name=modelname
  175. part=function(par, a, c, s, col, t, cf, ms)
  176. 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)
  177. local m=Instance.new("BlockMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
  178. return p
  179. end
  180. cylinder=function(par, a, c, s, col, t, cf, ms)
  181. 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)
  182. local m=Instance.new("CylinderMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
  183. return p
  184. end
  185. wedge=function(par, a, c, s, col, t, cf, ms)
  186. 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)
  187. local m=Instance.new("SpecialMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) m.MeshType="Wedge" end)
  188. return p
  189. end
  190. gui=function(ins, par, bc, bg, tc, fs, text, t, s, pos)
  191. 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
  192. return g
  193. end
  194. weld=function(par, p1, cf)
  195. local w=Instance.new("Weld", par) pcall(function() w.Part0=w.Parent or par w.Part1=p1 w.C1=cf or cn() end)
  196. return w
  197. end
  198. mesh=function(ins, par, s, t, id, tid, of)
  199. 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)
  200. 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)
  201. return m
  202. end
  203. sound=function(parent, id, pitch, volume)
  204. local s=Instance.new("Sound", parent) pcall(function() s.SoundId=id s.Volume=volume or 1 s.Pitch=pitch or 1 end)
  205. return s
  206. end
  207. function stick(from, to)
  208. local stickW=weld(from, to, to.CFrame:inverse()*from.CFrame)
  209. stickW.C0=from.CFrame:inverse()*from.CFrame
  210. return stickW
  211. end
  212. bp=Instance.new("BodyPosition") bp.D=200 bp.maxForce=vc(inf,inf,inf)
  213. base=part(delorean, false, true, vc(5, .5, 14), "Really black", 0, cn(0, 200, 0))
  214. wait()
  215. bp.Parent=base
  216. bp.position=(T.CFrame+T.CFrame.lookVector*20).p
  217. base.Name="BASE"
  218. bc=part(delorean, false, true, vc(7, .5, 6), "Really black")
  219. bcw=weld(bc, base, cn())
  220. bf=part(delorean, false, true, vc(7, .5, 2), "Really black")
  221. bfw=weld(bf, base, cn(0, 0, -7))
  222. local bb=part(delorean, false, true, vc(7, .5, 2), "Really black")
  223. local bbw=weld(bb, base, cn(0, 0, 7))
  224. local bf2=part(delorean, false, true, vc(6.8, 1, 1.5), "Really black")
  225. local bf2w=weld(bf2, bf, cn(0, .5, 0))
  226. local bc2=part(delorean, false, true, vc(5, 1, 5), "Really black")
  227. local bc2w=weld(bc2, base, cn(0, .75, -4.5))
  228. local bf3=part(delorean, false, true, vc(7, .5, 3), "Really black")
  229. local bf3w=weld(bf3, bf2, cn(0, .5, -.5))
  230. local enginesmoke=cylinder(delorean, false, true, vc(.5, 2, .5), "Dark stone grey")
  231. local enginesmokew=weld(enginesmoke, bb, cn(2, 0, .75)*ca(-rd(90), 0, 0))
  232. local enginesmoke=cylinder(delorean, false, true, vc(.5, 2, .5), "Dark stone grey")
  233. local enginesmokew=weld(enginesmoke, bb, cn(-2, 0, .75)*ca(-rd(90), 0, 0))
  234. local bf4=part(delorean, false, true, vc(7, .7, 3.5), "Mid gray")
  235. local bf4w=weld(bf4, bf3, cn(0, .6, .75))
  236. local bf5=part(delorean, false, true, vc(6, .7, 3), "Mid gray")
  237. local bf5w=weld(bf5, bf4, cn(0, 0, 3))
  238. local mprt=part(delorean, false, true, vc(7, 1, .5), "Medium stone grey", 0, cn(), vc(1, .1, 1))
  239. local mprtw=weld(mprt, bf4, cn(0, -.3, -2))
  240. local mprt=part(delorean, false, true, vc(7, 1, .35), "Medium stone grey", 0, cn(), vc(1, .1, 1))
  241. local mprtw=weld(mprt, bf4, cn(0, .3, -1.9))
  242. local mprt=part(delorean, false, true, vc(.2, .65, .5), "Medium stone grey", 0, cn(), vc(1, 1, 1))
  243. local mprtw=weld(mprt, bf4, cn(3.4, -.03, -1.9)*ca(rd(15), 0, 0))
  244. local mprt=part(delorean, false, true, vc(.2, .65, .5), "Medium stone grey", 0, cn(), vc(1, 1, 1))
  245. local mprtw=weld(mprt, bf4, cn(-3.4, -.03, -1.9)*ca(rd(15), 0, 0))
  246. local dmc=part(delorean, false, true, vc(2, .65, .5), "Really black", 0, cn(), vc(1, 1, 1))
  247. local dmcw=weld(dmc, bf4, cn(0, -.03, -1.9)*ca(rd(15), 0, 0))
  248. decal=Instance.new("Decal", dmc)
  249. decal.Texture="http://www.roblox.com/asset/?id=28924870"
  250. decal.Face="Front"
  251. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  252. local prtw=weld(prt, bc, cn(3.25, 1.25, -2.5)*ca(0, 0, 0))
  253. local w=wedge(delorean, false, false, vc(.5, 1, .5), "Mid gray")
  254. local w2=weld(w, prt, cn(0, -.5, .75)*ca(0,pi,0))
  255. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  256. local prtw=weld(prt, bc, cn(3.25, 1.25, -3)*ca(rd(-45), 0, 0))
  257. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  258. local prtw=weld(prt, bc, cn(-3.25, 1.25, -2.5)*ca(0, 0, 0))
  259. local w=wedge(delorean, false, false, vc(.5, 1, .5), "Mid gray")
  260. local w2=weld(w, prt, cn(0, -.5, .75)*ca(0,pi,0))
  261. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  262. local prtw=weld(prt, bc, cn(-3.25, 1.25, -3)*ca(rd(-45), 0, 0))
  263. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  264. local prtw=weld(prt, bc, cn(3.25, 1.25, 2.5)*ca(0, 0, 0))
  265. local prt2=part(delorean, false, true, vc(.5, 2.2, 1.5), "Mid gray")
  266. local prt2w=weld(prt2, prt, cn(-.25, 1.85, .25)*ca(0, 0, rd(10)))
  267. local w=wedge(delorean, false, false, vc(.5, 2, 1), "Mid gray")
  268. local w2=weld(w, prt, cn(0, 0, -1))
  269. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  270. local prtw=weld(prt, bc, cn(3.25, 1.25, 3)*ca(rd(45), 0, 0))
  271. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  272. local prtw=weld(prt, bc, cn(-3.25, 1.25, 2.5)*ca(0, 0, 0))
  273. local prt2=part(delorean, false, true, vc(.5, 2.2, 1.5), "Mid gray")
  274. local prt2w=weld(prt2, prt, cn(.25, 1.85, .25)*ca(0, 0, rd(-10)))
  275. local w=wedge(delorean, false, false, vc(.5, 2, 1), "Mid gray")
  276. local w2=weld(w, prt, cn(0, 0, -1))
  277. local prt=part(delorean, false, true, vc(.5, 2, 1), "Mid gray")
  278. local prtw=weld(prt, bc, cn(-3.25, 1.25, 3)*ca(rd(45), 0, 0))
  279. local main=part(delorean, false, true, vc(6, .5, 1.5), "Mid gray")
  280. local mainw=weld(main, base, cn(0, 4, 2.75))
  281. local stand=part(delorean, false, true, vc(.5, .5, 5.5), "Mid gray")
  282. local standw=weld(stand, base, cn(3,3,5.5)*ca(rd(22),rd(5),0))
  283. local stand=part(delorean, false, true, vc(.5, .5, 5.5), "Mid gray")
  284. local standw=weld(stand, base, cn(-3,3,5.5)*ca(rd(22),rd(-5),0))
  285. local backprt=part(delorean, false, true, vc(6, 2, .5), "Black")
  286. local backprt=weld(backprt, base, cn(0, 3, 2))
  287. local window=part(delorean, false, true, vc(5, 2.5, .25), "Black", .5)
  288. local windoww=weld(window, base, cn(0, 3, -1.25)*ca(rd(45), 0, 0))
  289. local border=part(delorean, false, false, vc(5, .5, .5), "Really black")
  290. local borderw=weld(border, window, cn(0, 1.5, 0))
  291. local border=part(delorean, false, false, vc(.5, 3, .5), "Really black")
  292. local borderw=weld(border, window, cn(2.5, 0, 0)*ca(0, 0, rd(10)))
  293. local border=part(delorean, false, false, vc(.5, 3, .5), "Really black")
  294. local borderw=weld(border, window, cn(-2.5, 0, 0)*ca(0, 0, rd(-10)))
  295. local prt=weld()
  296. local mainjoint=part(delorean, false, true, vc(2, .5, 2), "Mid gray")
  297. local mainjointw=weld(mainjoint, base, cn(0, 4, 1))
  298. local seat=part(delorean, false, false, vc(2, .5, 2), "Black")
  299. local seatw=weld(seat, base, cn(1.5, .25, 1))
  300. local backseat=part(delorean, false, false, vc(2, 2, .5), "Black")
  301. local backseatw=weld(backseat, seat, cn(0, 1, 1)*ca(rd(10), 0, 0))
  302. local headseat=part(delorean, false, false, vc(1.5, 1.25, .5), "Black")
  303. local headseatw=weld(headseat, seat, cn(0, 2.5, 1.15))
  304. local seat=part(delorean, false, false, vc(2, .5, 2), "Black")
  305. local seatw=weld(seat, base, cn(-1.5, .25, 1))
  306. local backseat=part(delorean, false, false, vc(2, 2, .5), "Black")
  307. local backseatw=weld(backseat, seat, cn(0, 1, 1)*ca(rd(10), 0, 0))
  308. local headseat=part(delorean, false, false, vc(1.5, 1.25, .5), "Black")
  309. local headseatw=weld(headseat, seat, cn(0, 2.5, 1.15))
  310. local line=part(delorean, false, false, vc(1, 1, 14), "Black")
  311. local linew=weld(line, base, cn(0, .5, 0))
  312. local back=part(delorean, false, true, vc(5, 1.5, 6), "Mid gray")
  313. local backw=weld(back, base, cn(0, 1, 5))
  314. local bb33s=part(delorean, false, true, vc(7, 1.5, 2), "Mid gray")
  315. local bb33sw=weld(bb33s, base, cn(0, 1, 7))
  316. local bbs=part(delorean, false, true, vc(7, .5, 1), "Really black")
  317. local bbsw=weld(bbs, base, cn(0, .25, 8.25)*ca(-rd(35), 0, 0))
  318. local bbs=part(delorean, false, true, vc(7, 1.5, .5), "Really black")
  319. local bbsw=weld(bbs, base, cn(0, 1, 8.25))
  320. local bb3s=part(delorean, false, true, vc(7, .5, .5), "Medium stone grey")
  321. local bb3sw=weld(bb3s, bb33s, cn(0, 1, 1.25))
  322. local bb3s=part(delorean, false, true, vc(7, .5, 6), "Mid gray")
  323. local bb3sw=weld(bb3s, bb33s, cn(0, 1, -2))
  324. decal=Instance.new("Decal", bb3s)
  325. decal.Texture="http://www.roblox.com/asset/?id=27893351"
  326. decal.Face="Top"
  327. rocket=wedge(delorean, false, true, vc(2,2,4), "Black")
  328. rocketw=weld(rocket, bb3s, cn(2,1,1.5))
  329. r2=wedge(delorean, false, true, vc(2,1,2), "Really black")
  330. r2w=weld(r2,rocket,cn(0,0,2.5)*ca(pi/2,pi,0))
  331. rocket=wedge(delorean, false, true, vc(2,2,4), "Black")
  332. rocketw=weld(rocket, bb3s, cn(-2,1,1.5))
  333. r2=wedge(delorean, false, true, vc(2,1,2), "Really black")
  334. r2w=weld(r2,rocket,cn(0,0,2.5)*ca(pi/2,pi,0))
  335. pp=part(delorean, false, true, vc(2,1,5), "Black")
  336. ppw=weld(pp,bb3s,cn(0,.5,0))
  337. reactor=part(delorean, false, true, vc(2,1.5,2), "Dark stone grey")
  338. reactorw=weld(reactor,pp,cn(0,-.25,1.5))
  339. reactorm=mesh("SpecialMesh", reactor, vc(.4,.1,.4), "FileMesh", "http://www.roblox.com/Asset/?id=10207677")
  340. cyl=cylinder(delorean,false,true,vc(.8,1.5,.8),"White")
  341. cylw=weld(cyl,reactor,cn(0,1.5,0))
  342. decal=Instance.new("Decal", cyl)
  343. decal.Texture="http://www.roblox.com/asset/?id=37389443"
  344. decal.Face="Front"
  345. decal=Instance.new("Decal", cyl)
  346. decal.Texture="http://www.roblox.com/asset/?id=37389443"
  347. decal.Face="Back"
  348. decal=Instance.new("Decal", cyl)
  349. decal.Texture="http://www.roblox.com/asset/?id=37389443"
  350. decal.Face="Right"
  351. decal=Instance.new("Decal", cyl)
  352. decal.Texture="http://www.roblox.com/asset/?id=37389319"
  353. decal.Face="Left"
  354. cyl2=cylinder(delorean,false,true,vc(.5,.5,.5),"Really black")
  355. cyl2w=weld(cyl2,cyl,cn(0,.75,0))
  356. but=part(delorean,false,true,vc(.4,.3,1),"Bright red")
  357. butw=weld(but,cyl,cn(0,-.5,.5))
  358. local wed=wedge(delorean, false, true, vc(7, .5, 3), "Mid gray")
  359. local wedw=weld(wed, bf2, cn(0, 0, -.5)*ca(0, 0, pi))
  360. local trunk=wedge(delorean, false, true, vc(7, .5, 6.35), "Mid gray")
  361. local trunkw=weld(trunk, bf4, cn(0, .6, 1.5))
  362. --TIRE
  363. local prts=6
  364. local rad=1.6
  365. local tfr=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Black")
  366. local tfrw=weld(tfr, base, cn(3,.25,-4.5)*ca(0,0,pi/2))
  367. local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Mid gray")
  368. local metw=weld(met, tfr, cn())
  369. for i=0,pi,pi/prts do
  370. local p=part(delorean, false, false, vc(1.1,1.1,.5), "Mid gray")
  371. p.CFrame=tfr.CFrame*cn(rad*sn(i), 0, rad*cs(i))
  372. p.CFrame=CFrame.new(p.CFrame.p, tfr.CFrame.p)
  373. stick(p, base)
  374. end
  375. local tfl=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Black")
  376. local tflw=weld(tfl, base, cn(-3,.25,-4.5)*ca(0,0,pi/2))
  377. local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Mid gray")
  378. local metw=weld(met, tfl, cn())
  379. for i=0,pi,pi/prts do
  380. local p=part(delorean, false, false, vc(1.1,1.1,.5), "Mid gray")
  381. p.CFrame=tfl.CFrame*cn(rad*sn(i), 0, rad*cs(i))
  382. p.CFrame=CFrame.new(p.CFrame.p, tfl.CFrame.p)
  383. stick(p, base)
  384. end
  385. local tbr=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Black")
  386. local tbrw=weld(tbr, base, cn(3,.25,4.5)*ca(0,0,pi/2))
  387. local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Mid gray")
  388. local metw=weld(met, tbr, cn())
  389. for i=0,pi,pi/prts do
  390. local p=part(delorean, false, false, vc(1.1,1.1,.5), "Mid gray")
  391. p.CFrame=tbr.CFrame*cn(rad*sn(i), 0, rad*cs(i))
  392. p.CFrame=CFrame.new(p.CFrame.p, tbr.CFrame.p)
  393. stick(p, base)
  394. end
  395. local tbl=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Black")
  396. local tblw=weld(tbl, base, cn(-3,.25,4.5)*ca(0,0,pi/2))
  397. local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Mid gray")
  398. local metw=weld(met, tbl, cn())
  399. for i=0,pi,pi/prts do
  400. local p=part(delorean, false, false, vc(1.1,1.1,.5), "Mid gray")
  401. p.CFrame=tbl.CFrame*cn(rad*sn(i), 0, rad*cs(i))
  402. p.CFrame=CFrame.new(p.CFrame.p, tbl.CFrame.p)
  403. stick(p, base)
  404. end
  405. atfr=function(cf)
  406. tfrw.C1=cn(3,.25,-4.5)*ca(0,0,pi/2)*cf
  407. end
  408. atfl=function(cf)
  409. tflw.C1=cn(-3,.25,-4.5)*ca(0,0,pi/2)*cf
  410. end
  411. atbr=function(cf)
  412. tblw.C1=cn(3,.25,4.5)*ca(0,0,pi/2)*cf
  413. end
  414. atbl=function(cf)
  415. tblw.C1=cn(-3,.25,4.5)*ca(0,0,pi/2)*cf
  416. end
  417. local trunkw=weld(trunk, bf4, cn(0, .6, 1.25))
  418. --SEATS
  419. --DOOR
  420. local DoorRight=Instance.new("Model", delorean)
  421. local djr=part(DoorRight, false, false, vc(1, 1, 1), "Mid gray", 1)
  422. local djrw=weld(djr, mainjoint, cn(1,0,0)*ca(0,0,0))
  423. local dp=part(DoorRight, false, true, vc(2, .5, 2), "Mid gray")
  424. local dpw=weld(dp, djr, cn(1, 0, 0))
  425. local dp2=part(DoorRight, false, true, vc(.5, .5, 3.25), "Mid gray")
  426. local dp2w=weld(dp2, dp, cn(1, -1, -2)*ca(rd(-45),rd(-10),0))
  427. local dp3=part(DoorRight, false, true, vc(.5, 2.2, .5), "Mid gray")
  428. local dp3w=weld(dp3, dp, cn(1, -.85, .75)*ca(0, 0, rd(15)))
  429. local dw=wedge(DoorRight, false, true, vc(.5, 2, 1), "Mid gray")
  430. local dww=weld(dw, dp, cn(1.25, -2.75, .5)*ca(pi,0,0))
  431. local dw=wedge(DoorRight, false, true, vc(.5,1,.5), "Mid gray")
  432. local dww=weld(dw, dp, cn(1.25, -3.25, -2.75)*ca(pi, pi, 0))
  433. local dp4=part(DoorRight, false, true, vc(.5,1,.5), "Mid gray")
  434. local dp4w=weld(dp4, dp, cn(1.25, -2.25, -2.75))
  435. local dp5=part(DoorRight, false, true, vc(.5,2,2.5), "Mid gray")
  436. local dp5w=weld(dp5, dp, cn(1.25, -2.75, -1.25))
  437. local dwindow=wedge(DoorRight, false, true, vc(.25, 2, 2), "Really black", .5)
  438. local dwindoww=weld(dwindow, dp, cn(1, -1, -1.75)*ca(0, 0, rd(15)))
  439. local dwindow=part(DoorRight, false, true, vc(.25, 2, 1.5), "Really black", .5)
  440. local dwindoww=weld(dwindow, dp, cn(1, -1, 0)*ca(0, 0, rd(15)))
  441. local glass=part(DoorRight, false, true, vc(1, .5, .2), "Really black")
  442. local glassw=weld(glass, dp, cn(1.5, -1.5, -2)*ca(0, rd(-35), 0))
  443. local actr=false
  444. local debr=false
  445. function clickr()
  446. if actr==false then
  447. if debr==false then
  448. debr=true
  449. for i=0, 1, .1 do
  450. djrw.C1=cn(1,0,0)*ca(0,0,rd(90)*i)
  451. wait()
  452. end
  453. debr=false
  454. actr=true
  455. end
  456. elseif actr==true then
  457. if debr==false then
  458. debr=true
  459. for i=1, 0, -.1 do
  460. djrw.C1=cn(1,0,0)*ca(0,0,rd(90)*i)
  461. wait()
  462. end
  463. debr=false
  464. actr=false
  465. end
  466. end
  467. end
  468. for i, v in pairs(DoorRight:children()) do
  469. local cdetector=Instance.new("ClickDetector", v)
  470. cdetector.MouseClick:connect(clickr)
  471. end
  472. local DoorLeft=Instance.new("Model", delorean)
  473. local djl=part(DoorLeft, false, false, vc(1, 1, 1), "Mid gray", 1)
  474. local djlw=weld(djl, mainjoint, cn(-1,0,0))
  475. local dp=part(DoorLeft, false, true, vc(2, .5, 2), "Mid gray")
  476. local dpw=weld(dp, djl, cn(-1, 0, 0))
  477. local dp2=part(DoorLeft, false, true, vc(.5, .5, 3.25), "Mid gray")
  478. local dp2w=weld(dp2, dp, cn(-1, -1, -2)*ca(rd(-45),rd(10),0))
  479. local dp3=part(DoorLeft, false, true, vc(.5, 2.2, .5), "Mid gray")
  480. local dp3w=weld(dp3, dp, cn(-1, -.85, .75)*ca(0, 0, rd(-15)))
  481. local dw=wedge(DoorLeft, false, true, vc(.5, 2, 1), "Mid gray")
  482. local dww=weld(dw, dp, cn(-1.25, -2.75, .5)*ca(pi,0,0))
  483. local dw=wedge(DoorLeft, false, true, vc(.5,1,.5), "Mid gray")
  484. local dww=weld(dw, dp, cn(-1.25, -3.25, -2.75)*ca(pi, pi, 0))
  485. local dp4=part(DoorLeft, false, true, vc(.5,1,.5), "Mid gray")
  486. local dp4w=weld(dp4, dp, cn(-1.25, -2.25, -2.75))
  487. local dp5=part(DoorLeft, false, true, vc(.5,2,2.5), "Mid gray")
  488. local dp5w=weld(dp5, dp, cn(-1.25, -2.75, -1.25))
  489. local dwindow=wedge(DoorLeft, false, true, vc(.25, 2, 2), "Really black", .5)
  490. local dwindoww=weld(dwindow, dp, cn(-1, -1, -1.75)*ca(0, 0, rd(-15)))
  491. local dwindow=part(DoorLeft, false, true, vc(.25, 2, 1.5), "Really black", .5)
  492. local dwindoww=weld(dwindow, dp, cn(-1, -1, 0)*ca(0, 0, rd(-15)))
  493. local glass=part(DoorLeft, false, true, vc(1, .5, .2), "Really black")
  494. local glassw=weld(glass, dp, cn(-1.5, -1.5, -2)*ca(0, rd(35), 0))
  495. local actl=false
  496. local debl=false
  497. function clickl()
  498. if actl==false then
  499. if debl==false then
  500. debl=true
  501. for i=0, 1, .1 do
  502. djlw.C1=cn(-1,0,0)*ca(0,0,rd(-90)*i)
  503. wait()
  504. end
  505. debl=false
  506. actl=true
  507. end
  508. elseif actl==true then
  509. if debl==false then
  510. debl=true
  511. for i=1, 0, -.1 do
  512. djlw.C1=cn(-1,0,0)*ca(0,0,rd(-90)*i)
  513. wait()
  514. end
  515. debl=false
  516. actl=false
  517. end
  518. end
  519. end
  520. for i, v in pairs(DoorLeft:children()) do
  521. local cdetector=Instance.new("ClickDetector", v)
  522. cdetector.MouseClick:connect(clickl)
  523. end
  524. local bf=Instance.new("BodyForce")
  525. local bav=Instance.new("BodyAngularVelocity") bav.angularvelocity=vc(0,0,0) bav.maxTorque=vc(math.huge,math.huge,math.huge)
  526. local vs=Instance.new("VehicleSeat", delorean)
  527. vs.HeadsUpDisplay=false
  528. vs.CanCollide=false
  529. vs.Transparency=1
  530. vs.Size=Vector3.new(2, .5, 2)
  531. weld(vs, base, cn(-1.5, 0, 1))
  532. local ps=Instance.new("VehicleSeat", delorean)
  533. ps.HeadsUpDisplay=false
  534. ps.CanCollide=false
  535. ps.Size=Vector3.new(2, .5, 2)
  536. ps.Transparency=1
  537. weld(ps, base, cn(1.5, 0, 1))
  538. torsos={}
  539. ps.ChildAdded:connect(function(w)
  540. if w.Name=="SeatWeld" then
  541. torso=w.Part1
  542. if torso then
  543. for i, v2 in pairs(torso.Parent:children()) do
  544. if v2:isA("BasePart") then
  545. for i, v3 in pairs(v2:children()) do
  546. if v3:isA("CFrameValue") then
  547. v3:remove()
  548. end
  549. end
  550. end
  551. end
  552. end
  553. table.insert(torsos, torso)
  554. w.C1=w.C1*CFrame.new(0, 0, .5)
  555. end
  556. end)
  557. running=false
  558. vs.ChildAdded:connect(function(w)
  559. if w.Name=="SeatWeld" then
  560. torso=w.Part1
  561. w.C1=w.C1*CFrame.new(0, 0, .5)
  562. if torso then
  563. for i, v2 in pairs(torso.Parent:children()) do
  564. if v2:isA("BasePart") then
  565. for i, v3 in pairs(v2:children()) do
  566. if v3:isA("CFrameValue") then
  567. v3:remove()
  568. end
  569. end
  570. end
  571. end
  572. table.insert(torsos, torso)
  573. local player=game.Players:getPlayerFromCharacter(torso.Parent)
  574. screengui=Instance.new("ScreenGui", player.PlayerGui) screengui.Name=modelname
  575. speedometer=gui("TextLabel", screengui, "Black", "Black", "Really black", "Size48", "0", 1, UDim2.new(0, 100, 0, 100), UDim2.new(0, 50, .85, 0))
  576. hourlabel=gui("TextLabel", screengui, "Black", "Black", "Really black", "Size48", "HH", 1, UDim2.new(0, 100, 0, 50), UDim2.new(.7, 0, .8, 0))
  577. minutelabel=gui("TextLabel", hourlabel, "Black", "Black", "Really black", "Size48", "MM", 1, UDim2.new(1, 0, 1, 0), UDim2.new(1, 0, 0, 0))
  578. secondlabel=gui("TextLabel", minutelabel, "Black", "Black", "Really black", "Size48", "SS", 1, UDim2.new(1, 0, 1, 0), UDim2.new(1, 0, 0, 0))
  579. hourbox=gui("TextBox", hourlabel, "Black", "Black", "Really red", "Size48", "24", 1, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  580. minutebox=gui("TextBox", minutelabel, "Black", "Black", "Really red", "Size48", "00", 1, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  581. secondbox=gui("TextBox", secondlabel, "Black", "Black", "Really red", "Size48", "00", 1, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  582. running=true
  583. run()
  584. end
  585. end
  586. end)
  587. vs.ChildRemoved:connect(function(w)
  588. if w.Name=="SeatWeld" then
  589. torso=w.Part1
  590. if torso then
  591. for i, v in pairs(torsos) do
  592. if v==torso then
  593. table.remove(torsos,i)
  594. end
  595. end
  596. local player=game.Players:getPlayerFromCharacter(torso.Parent)
  597. player.PlayerGui[modelname]:remove()
  598. running=false
  599. end
  600. end
  601. end)
  602. ps.ChildRemoved:connect(function(w)
  603. if w.Name=="SeatWeld" then
  604. torso=w.Part1
  605. if torso then
  606. for i, v in pairs(torsos) do
  607. if v==torso then
  608. table.remove(torsos,i)
  609. end
  610. end
  611. end
  612. end
  613. end)
  614. c(function()wait(.5) bp:remove()end)
  615. function makelightning(from, to, thick, col)
  616. local magnitude=(from.p-to.p).magnitude
  617. local distance=(from.p+to.p)/2
  618. local pattern=part(workspace, true, false, vc(.2, .2, magnitude), "White", 1, cn(distance, from.p))
  619. local fromPosProx=from.p
  620. for i=1, 4 do
  621. local fromPosProx2=fromPosProx
  622. local random=vc(rn(-1, 1), rn(-1, 1), rn(-1, 1))
  623. local findSize=pattern.Size.z/3
  624. local findOffSet=pattern.CFrame.lookVector*-1
  625. local compute=i*findSize*findOffSet
  626. local newfromPos=from.p
  627. local newEndPos=cn(random+compute+newfromPos).p
  628. local magnitude=(fromPosProx2-newEndPos).magnitude
  629. local distance=(fromPosProx2+newEndPos)/2
  630. local lightning=part(workspace, true, false, vc(1, 1, 1), col or "Bright yellow", 0, cn(distance, fromPosProx2), vc(thick, thick, magnitude))
  631. fromPosProx=newEndPos
  632. game.Debris:addItem(lightning, .5)
  633. end
  634. pattern:remove()
  635. end
  636. function play(soundid, pitch, volume)
  637. local sound=sound(workspace, soundid, pitch, volume)
  638. sound:play()
  639. c(function() wait(5) sound:remove() end)
  640. end
  641. trm=Instance.new("Model", delorean)
  642. function trail(prt, cf, thick, col)
  643. local old=(prt.CFrame*(cf or cn())).p
  644. 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))
  645. c(function()
  646. for i=1, 0, -.001 do pc(function() trail.Mesh.Scale=trail.Mesh.Scale*vc(i, i, i) end) wait() end
  647. trail:remove()
  648. end)
  649. end
  650. Targets={}
  651. timedeb=false
  652. num=0
  653. maxnum=400
  654. origin=0
  655. function stick(from, to)
  656. local stickW=weld(from, to, to.CFrame:inverse()*from.CFrame)
  657. stickW.C0=from.CFrame:inverse()*from.CFrame
  658. return stickW
  659. end
  660. local bp=Instance.new("BodyPosition") bp.D=100 bp.maxForce=vc(inf,inf,inf)
  661. timedeb=false
  662. function run()
  663. num=0
  664. c(function()
  665. for i, v in pairs(workspace:children()) do
  666. if v:isA("Model") then
  667. for i, v2 in pairs(v:children()) do
  668. if v2:isA("BasePart") then
  669. for i, v3 in pairs(v2:children()) do
  670. if v3:isA("CFrameValue") then
  671. v3:remove()
  672. end
  673. end
  674. end
  675. end
  676. end
  677. end
  678. timedeb=true
  679. while true do
  680. --TimeContinium-----------------------------
  681. if num<=0 and timedeb==true then
  682. for i, v in pairs(workspace:children()) do
  683. if v:isA("BasePart") then
  684. if v.Anchored==false then
  685. table.insert(Targets, v)
  686. local Origin = Instance.new("CFrameValue")
  687. Origin.Parent = v
  688. Origin.Name = "Origin CFrame"
  689. Origin.Value = v.CFrame
  690. end
  691. end
  692. for i, t in pairs(torsos) do
  693. if v:isA("Model") and v~=t.Parent and v~=delorean then
  694. for i, v2 in pairs(v:children()) do
  695. if v2:isA("BasePart") then
  696. table.insert(Targets, v2)
  697. local Origin = Instance.new("CFrameValue")
  698. Origin.Parent = v2
  699. Origin.Name = "Origin CFrame"
  700. Origin.Value = v2.CFrame
  701. end
  702. end
  703. end
  704. end
  705. end
  706. ---------
  707. while num<maxnum and timedeb==true do ---print(num)
  708. for i, v in pairs(workspace:children()) do
  709. if v:isA("BasePart") and v:findFirstChild("Origin CFrame")==nil then
  710. if v.Anchored==false then
  711. table.insert(Targets, v)
  712. local Origin = Instance.new("CFrameValue")
  713. Origin.Parent = v
  714. Origin.Name = "Origin CFrame"
  715. Origin.Value = v.CFrame
  716. end
  717. end
  718. for i, t in pairs(torsos) do
  719. if v:isA("Model") and v~=t.Parent and v~=delorean then
  720. for i, v2 in pairs(v:children()) do
  721. if v2:isA("BasePart") and v2:findFirstChild("Origin CFrame")==nil then
  722. table.insert(Targets, v2)
  723. local Origin = Instance.new("CFrameValue")
  724. Origin.Parent = v2
  725. Origin.Name = "Origin CFrame"
  726. Origin.Value = v2.CFrame
  727. end
  728. end
  729. end
  730. end
  731. end
  732. for i, v in pairs(Targets) do
  733. local History = Instance.new("CFrameValue")
  734. History.Parent = v
  735. History.Name = num
  736. History.Value = v.CFrame
  737. end
  738. num = num + 1
  739. wait()
  740. end
  741. end
  742. wait()
  743. end
  744. end)
  745. while running do
  746. local speed=base.Velocity.magnitude
  747. speedometer.Text=math.floor(speed)
  748. if speed>65 and speed<88 then play("http://www.roblox.com/asset/?id=2800815", 1, .5)
  749. makelightning(base.CFrame*CFrame.new(0,0,10), base.CFrame*CFrame.new(rn(-10,10),rn(-10,10),rn(-2,10)), 1)
  750. trail(tbr,cn(-1.5, 0, -10),2.5,"Bright orange")
  751. trail(tbl,cn(-1.9, 0, -10),2.5,"Bright orange")
  752. end
  753. if speed>88 and speed<90 then play("http://roblox.com/asset/?id=10209481")
  754. local trm2=trm:clone() trm2.Parent=workspace
  755. origin=base.Position
  756. print(origin)
  757. game.Debris:addItem(trm2, 5)
  758. bp.position=vc(0,0,-99999)
  759. bp.Parent=base
  760. timedeb=false
  761. c(function()
  762. for i=0,1,.005 do
  763. game.Lighting.TimeOfDay=math.floor(hourbox.Text*i)..":"..math.floor(minutebox.Text*i)..":"..math.floor(secondbox.Text*i)
  764. wait()
  765. end
  766. end)
  767. while num > 0 do --print(num)
  768. wait()
  769. num = num - 1
  770. for i, v in pairs(Targets) do
  771. v.Anchored=true
  772. local History = v:findFirstChild(num)
  773. if History ~= nil then
  774. v.CFrame = History.Value
  775. History:remove()
  776. end
  777. end
  778. end
  779. for i, v in pairs(Targets) do
  780. local Origin = v:findFirstChild("Origin CFrame")
  781. if Origin ~= nil then
  782. v.CFrame = Origin.Value
  783. v:makeJoints()
  784. Origin:remove()
  785. end
  786. end
  787. for i, v in pairs(Targets) do
  788. v.Anchored=false
  789. end
  790. play("http://www.roblox.com/asset/?id=2101148", 1, 1)
  791. exp=Instance.new("Explosion", workspace)
  792. exp.BlastPressure=0
  793. exp.Position=origin
  794. Targets = {}
  795. timedeb=true
  796. bp.position=origin
  797. origin=0
  798. base.Velocity=vc(0,0,0)
  799. bf.force=base.CFrame.lookVector*0
  800. wait(1)
  801. bp:remove()
  802. end
  803. if vs.Steer==0 then bav.angularvelocity=vc(0,0,0) atfr(ca(0, 0, 0)) atfl(ca(0, 0, 0)) end
  804. if vs.Steer==1 then atfr(ca(rd(-25), 0, 0)) atfl(ca(rd(-25), 0, 0)) end
  805. if vs.Steer==-1 then atfr(ca(rd(25), 0, 0)) atfl(ca(rd(25), 0, 0)) end
  806. if vs.Throttle==1 then bav.Parent=base bf.Parent=base
  807. if vs.Steer==1 then bav.angularvelocity=vc(0,-2,0) end
  808. if vs.Steer==-1 then bav.angularvelocity=vc(0,2,0) end
  809. bf.force=base.CFrame.lookVector*40000
  810. end
  811. if vs.Throttle==0 then bav.Parent=base bf.Parent=base
  812. bf.force=base.CFrame.lookVector*0
  813. end
  814. if vs.Throttle==-1 then bav.Parent=base bf.Parent=base
  815. if vs.Steer==1 then bav.angularvelocity=vc(0,2,0) end
  816. if vs.Steer==-1 then bav.angularvelocity=vc(0,-2,0) end
  817. bf.force=base.CFrame.lookVector*-40000
  818. end
  819. wait()
  820. end
  821. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement