View difference between Paste ID: nRyPUyEZ and CRJaZN0z
SHOW: | | - or go back to the newest paste.
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 plr=game:service("Players")["BackFlame"]
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
153
wait(0.2)
154
155
local modelname="DeLoreanTimeMachine"
156
pcall(function() workspace.Base.CFrame=CFrame.new(0,-2,0) end)
157
print(modelname.."_LOADED")
158
local plr=game:GetService("Players").LocalPlayer
159
local char=plr.Character
160
local T=char.Torso
161
local c=function(f) coroutine.resume(coroutine.create(f)) end
162
local pc=pcall
163
pc(function() workspace:findFirstChild(modelname):remove() end)
164
local mouse=nil
165
local pi=math.pi
166
local rd=math.rad
167
local sn=math.sin
168
local cs=math.cos
169
local rn=math.random
170
local ti=table.insert
171
local tr=table.remove
172
local inf=math.huge
173
local cn=CFrame.new
174
local vc=Vector3.new
175
local ca=CFrame.Angles
176
local delorean=Instance.new("Model", workspace) delorean.Name=modelname
177
local screengui=Instance.new("ScreenGui") screengui.Name=modelname
178
part=function(par, a, c, s, col, t, cf, ms)
179
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)
180
local m=Instance.new("BlockMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
181
return p
182
end
183
cylinder=function(par, a, c, s, col, t, cf, ms)
184
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)
185
local m=Instance.new("CylinderMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
186
return p
187
end
188
wedge=function(par, a, c, s, col, t, cf, ms)
189
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)
190
local m=Instance.new("SpecialMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) m.MeshType="Wedge" end)
191
return p
192
end
193
gui=function(ins, par, bc, bg, tc, fs, text, t, s, pos)
194
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 
195
return g
196
end
197
weld=function(par, p1, cf)
198
local w=Instance.new("Weld", par) pcall(function() w.Part0=w.Parent or par w.Part1=p1 w.C1=cf or cn() end)
199
return w
200
end
201
mesh=function(ins, par, s, t, id, tid, of)
202
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)
203
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)
204
return m
205
end
206
sound=function(parent, id, pitch, volume)
207
local s=Instance.new("Sound", parent) pcall(function() s.SoundId=id s.Volume=volume or 1 s.Pitch=pitch or 1 end)
208
return s
209
end
210
function stick(from, to)
211
local stickW=weld(from, to, to.CFrame:inverse()*from.CFrame)
212
stickW.C0=from.CFrame:inverse()*from.CFrame
213
return stickW
214
end
215
bp=Instance.new("BodyPosition") bp.D=200 bp.maxForce=vc(inf,inf,inf)
216
base=part(delorean, false, true, vc(5, .5, 14), "Really Really red", 0, cn(0, 200, 0))
217
wait()
218
bp.Parent=base
219
bp.position=(T.CFrame+T.CFrame.lookVector*20).p
220
base.Name="BASE"
221
bc=part(delorean, false, true, vc(7, .5, 6), "Really Really red")
222
bcw=weld(bc, base, cn())
223
bf=part(delorean, false, true, vc(7, .5, 2), "Really Really red")
224
bfw=weld(bf, base, cn(0, 0, -7))
225
local bb=part(delorean, false, true, vc(7, .5, 2), "Really Really red")
226
local bbw=weld(bb, base, cn(0, 0, 7))
227
local bf2=part(delorean, false, true, vc(6.8, 1, 1.5), "Really Really red")
228
local bf2w=weld(bf2, bf, cn(0, .5, 0))
229
local bc2=part(delorean, false, true, vc(5, 1, 5), "Really Really red")
230
local bc2w=weld(bc2, base, cn(0, .75, -4.5))
231
local bf3=part(delorean, false, true, vc(7, .5, 3), "Really Really red")
232
local bf3w=weld(bf3, bf2, cn(0, .5, -.5))
233
local enginesmoke=cylinder(delorean, false, true, vc(.5, 2, .5), "Really red")
234
local enginesmokew=weld(enginesmoke, bb, cn(2, 0, .75)*ca(-rd(90), 0, 0))
235
local enginesmoke=cylinder(delorean, false, true, vc(.5, 2, .5), "Really red")
236
local enginesmokew=weld(enginesmoke, bb, cn(-2, 0, .75)*ca(-rd(90), 0, 0))
237
local bf4=part(delorean, false, true, vc(7, .7, 3.5), "Really red")
238
local bf4w=weld(bf4, bf3, cn(0, .6, .75))
239
local bf5=part(delorean, false, true, vc(6, .7, 3), "Really red")
240
local bf5w=weld(bf5, bf4, cn(0, 0, 3))
241
local mprt=part(delorean, false, true, vc(7, 1, .5), "Really red", 0, cn(), vc(1, .1, 1))
242
local mprtw=weld(mprt, bf4, cn(0, -.3, -2))
243
local mprt=part(delorean, false, true, vc(7, 1, .35), "Really red", 0, cn(), vc(1, .1, 1))
244
local mprtw=weld(mprt, bf4, cn(0, .3, -1.9))
245
local mprt=part(delorean, false, true, vc(.2, .65, .5), "Really red", 0, cn(), vc(1, 1, 1))
246
local mprtw=weld(mprt, bf4, cn(3.4, -.03, -1.9)*ca(rd(15), 0, 0))
247
local mprt=part(delorean, false, true, vc(.2, .65, .5), "Really red", 0, cn(), vc(1, 1, 1))
248
local mprtw=weld(mprt, bf4, cn(-3.4, -.03, -1.9)*ca(rd(15), 0, 0))
249
local dmc=part(delorean, false, true, vc(2, .65, .5), "Really Really red", 0, cn(), vc(1, 1, 1))
250
local dmcw=weld(dmc, bf4, cn(0, -.03, -1.9)*ca(rd(15), 0, 0))
251
decal=Instance.new("Decal", dmc)
252
decal.Texture="http://www.roblox.com/asset/?id=28924870"
253
decal.Face="Front"
254
local prt=part(delorean, false, true, vc(.5, 2, 1), "Really Really red")
255
local prtw=weld(prt, bc, cn(3.25, 1.25, -2.5)*ca(0, 0, 0))
256
local w=wedge(delorean, false, false, vc(.5, 1, .5), "Really Really red")
257
local w2=weld(w, prt, cn(0, -.5, .75)*ca(0,pi,0))
258
local prt=part(delorean, false, true, vc(.5, 2, 1), "Really Really red")
259
local prtw=weld(prt, bc, cn(3.25, 1.25, -3)*ca(rd(-45), 0, 0))
260
local prt=part(delorean, false, true, vc(.5, 2, 1), "Really Really red")
261
local prtw=weld(prt, bc, cn(-3.25, 1.25, -2.5)*ca(0, 0, 0))
262
local w=wedge(delorean, false, false, vc(.5, 1, .5), "Really Really red")
263
local w2=weld(w, prt, cn(0, -.5, .75)*ca(0,pi,0))
264
local prt=part(delorean, false, true, vc(.5, 2, 1), "Really Really red")
265
local prtw=weld(prt, bc, cn(-3.25, 1.25, -3)*ca(rd(-45), 0, 0))
266
local prt=part(delorean, false, true, vc(.5, 2, 1), "Really Really red")
267
local prtw=weld(prt, bc, cn(3.25, 1.25, 2.5)*ca(0, 0, 0))
268
local prt2=part(delorean, false, true, vc(.5, 2.2, 1.5), "Really Really red")
269
local prt2w=weld(prt2, prt, cn(-.25, 1.85, .25)*ca(0, 0, rd(10)))
270
local w=wedge(delorean, false, false, vc(.5, 2, 1), "Really Really red")
271
local w2=weld(w, prt, cn(0, 0, -1))
272
local prt=part(delorean, false, true, vc(.5, 2, 1), "Really Really red")
273
local prtw=weld(prt, bc, cn(3.25, 1.25, 3)*ca(rd(45), 0, 0))
274
local prt=part(delorean, false, true, vc(.5, 2, 1), "Really Really red")
275
local prtw=weld(prt, bc, cn(-3.25, 1.25, 2.5)*ca(0, 0, 0))
276
local prt2=part(delorean, false, true, vc(.5, 2.2, 1.5), "Really Really red")
277
local prt2w=weld(prt2, prt, cn(.25, 1.85, .25)*ca(0, 0, rd(-10)))
278
local w=wedge(delorean, false, false, vc(.5, 2, 1), "Really Really red")
279
local w2=weld(w, prt, cn(0, 0, -1))
280
local prt=part(delorean, false, true, vc(.5, 2, 1), "Really Really red")
281
local prtw=weld(prt, bc, cn(-3.25, 1.25, 3)*ca(rd(45), 0, 0))
282
local main=part(delorean, false, true, vc(6, .5, 1.5), "Really Really red")
283
local mainw=weld(main, base, cn(0, 4, 2.75))
284
local stand=part(delorean, false, true, vc(.5, .5, 5.5), "Really Really red")
285
local standw=weld(stand, base, cn(3,3,5.5)*ca(rd(22),rd(5),0))
286
local stand=part(delorean, false, true, vc(.5, .5, 5.5), "Really Really red")
287
local standw=weld(stand, base, cn(-3,3,5.5)*ca(rd(22),rd(-5),0))
288
local backprt=part(delorean, false, true, vc(6, 2, .5), "Really red")
289
local backprt=weld(backprt, base, cn(0, 3, 2))
290
local window=part(delorean, false, true, vc(5, 2.5, .25), "Really red", .5)
291
local windoww=weld(window, base, cn(0, 3, -1.25)*ca(rd(45), 0, 0))
292
local border=part(delorean, false, false, vc(5, .5, .5), "Really Really red")
293
local borderw=weld(border, window, cn(0, 1.5, 0))
294
local border=part(delorean, false, false, vc(.5, 3, .5), "Really Really red")
295
local borderw=weld(border, window, cn(2.5, 0, 0)*ca(0, 0, rd(10)))
296
local border=part(delorean, false, false, vc(.5, 3, .5), "Really Really red")
297
local borderw=weld(border, window, cn(-2.5, 0, 0)*ca(0, 0, rd(-10)))
298
local prt=weld()
299
local mainjoint=part(delorean, false, true, vc(2, .5, 2), "Really Really red")
300
local mainjointw=weld(mainjoint, base, cn(0, 4, 1))
301
local seat=part(delorean, false, false, vc(2, .5, 2), "Really red")
302
local seatw=weld(seat, base, cn(1.5, .25, 1))
303
local backseat=part(delorean, false, false, vc(2, 2, .5), "Really red")
304
local backseatw=weld(backseat, seat, cn(0, 1, 1)*ca(rd(10), 0, 0))
305
local headseat=part(delorean, false, false, vc(1.5, 1.25, .5), "Really red")
306
local headseatw=weld(headseat, seat, cn(0, 2.5, 1.15))
307
local seat=part(delorean, false, false, vc(2, .5, 2), "Really red")
308
local seatw=weld(seat, base, cn(-1.5, .25, 1))
309
local backseat=part(delorean, false, false, vc(2, 2, .5), "Really red")
310
local backseatw=weld(backseat, seat, cn(0, 1, 1)*ca(rd(10), 0, 0))
311
local headseat=part(delorean, false, false, vc(1.5, 1.25, .5), "Really red")
312
local headseatw=weld(headseat, seat, cn(0, 2.5, 1.15))
313
local line=part(delorean, false, false, vc(1, 1, 14), "Really red")
314
local linew=weld(line, base, cn(0, .5, 0))
315
local back=part(delorean, false, true, vc(5, 1.5, 6), "Really Really red")
316
local backw=weld(back, base, cn(0, 1, 5))
317
local bb33s=part(delorean, false, true, vc(7, 1.5, 2), "Really Really red")
318
local bb33sw=weld(bb33s, base, cn(0, 1, 7))
319
local bbs=part(delorean, false, true, vc(7, .5, 1), "Really Really red")
320
local bbsw=weld(bbs, base, cn(0, .25, 8.25)*ca(-rd(35), 0, 0))
321
local bbs=part(delorean, false, true, vc(7, 1.5, .5), "Really Really red")
322
local bbsw=weld(bbs, base, cn(0, 1, 8.25))
323
local bb3s=part(delorean, false, true, vc(7, .5, .5), "Really red")
324
local bb3sw=weld(bb3s, bb33s, cn(0, 1, 1.25))
325
local bb3s=part(delorean, false, true, vc(7, .5, 6), "Really Really red")
326
local bb3sw=weld(bb3s, bb33s, cn(0, 1, -2))
327
decal=Instance.new("Decal", bb3s)
328
decal.Texture="http://www.roblox.com/asset/?id=27893351"
329
decal.Face="Top"
330
rocket=wedge(delorean, false, true, vc(2,2,4), "Really red")
331
rocketw=weld(rocket, bb3s, cn(2,1,1.5))
332
r2=wedge(delorean, false, true, vc(2,1,2), "Really Really red")
333
r2w=weld(r2,rocket,cn(0,0,2.5)*ca(pi/2,pi,0))
334
rocket=wedge(delorean, false, true, vc(2,2,4), "Really red")
335
rocketw=weld(rocket, bb3s, cn(-2,1,1.5))
336
r2=wedge(delorean, false, true, vc(2,1,2), "Really Really red")
337
r2w=weld(r2,rocket,cn(0,0,2.5)*ca(pi/2,pi,0))
338
pp=part(delorean, false, true, vc(2,1,5), "Really red")
339
ppw=weld(pp,bb3s,cn(0,.5,0))
340
reactor=part(delorean, false, true, vc(2,1.5,2), "Really red")
341
reactorw=weld(reactor,pp,cn(0,-.25,1.5))
342
reactorm=mesh("SpecialMesh", reactor, vc(.4,.1,.4), "FileMesh", "http://www.roblox.com/Asset/?id=10207677")
343
cyl=cylinder(delorean,false,true,vc(.8,1.5,.8),"White")
344
cylw=weld(cyl,reactor,cn(0,1.5,0))
345
decal=Instance.new("Decal", cyl)
346
decal.Texture="http://www.roblox.com/asset/?id=37389443"
347
decal.Face="Front"
348
decal=Instance.new("Decal", cyl)
349
decal.Texture="http://www.roblox.com/asset/?id=37389443"
350
decal.Face="Back"
351
decal=Instance.new("Decal", cyl)
352
decal.Texture="http://www.roblox.com/asset/?id=37389443"
353
decal.Face="Right"
354
decal=Instance.new("Decal", cyl)
355
decal.Texture="http://www.roblox.com/asset/?id=37389319"
356
decal.Face="Left"
357
cyl2=cylinder(delorean,false,true,vc(.5,.5,.5),"Really Really red")
358
cyl2w=weld(cyl2,cyl,cn(0,.75,0))
359
but=part(delorean,false,true,vc(.4,.3,1),"Bright red")
360
butw=weld(but,cyl,cn(0,-.5,.5))
361
local wed=wedge(delorean, false, true, vc(7, .5, 3), "Really Really red")
362
local wedw=weld(wed, bf2, cn(0, 0, -.5)*ca(0, 0, pi))
363
local trunk=wedge(delorean, false, true, vc(7, .5, 6.35), "Really Really red")
364
local trunkw=weld(trunk, bf4, cn(0, .6, 1.5))
365
--TIRE
366
local prts=6
367
local rad=1.6
368
local tfr=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Really red")
369
local tfrw=weld(tfr, base, cn(3,.25,-4.5)*ca(0,0,pi/2))
370
local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Really Really red")
371
local metw=weld(met, tfr, cn())
372
for i=0,pi,pi/prts do
373
local p=part(delorean, false, false, vc(1.1,1.1,.5), "Really Really red")
374
p.CFrame=tfr.CFrame*cn(rad*sn(i), 0, rad*cs(i))
375
p.CFrame=CFrame.new(p.CFrame.p, tfr.CFrame.p)
376
stick(p, base)
377
end
378
local tfl=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Really red")
379
local tflw=weld(tfl, base, cn(-3,.25,-4.5)*ca(0,0,pi/2))
380
local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Really Really red")
381
local metw=weld(met, tfl, cn())
382
for i=0,pi,pi/prts do
383
local p=part(delorean, false, false, vc(1.1,1.1,.5), "Really Really red")
384
p.CFrame=tfl.CFrame*cn(rad*sn(i), 0, rad*cs(i))
385
p.CFrame=CFrame.new(p.CFrame.p, tfl.CFrame.p)
386
stick(p, base)
387
end
388
local tbr=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Really red")
389
local tbrw=weld(tbr, base, cn(3,.25,4.5)*ca(0,0,pi/2))
390
local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Really Really red")
391
local metw=weld(met, tbr, cn())
392
for i=0,pi,pi/prts do
393
local p=part(delorean, false, false, vc(1.1,1.1,.5), "Really Really red")
394
p.CFrame=tbr.CFrame*cn(rad*sn(i), 0, rad*cs(i))
395
p.CFrame=CFrame.new(p.CFrame.p, tbr.CFrame.p)
396
stick(p, base)
397
end
398
local tbl=cylinder(delorean, false, true, vc(2.5, 1, 2.5), "Really red")
399
local tblw=weld(tbl, base, cn(-3,.25,4.5)*ca(0,0,pi/2))
400
local met=cylinder(delorean, false, true, vc(1.5, 1.1, 1.5), "Really Really red")
401
local metw=weld(met, tbl, cn())
402
for i=0,pi,pi/prts do
403
local p=part(delorean, false, false, vc(1.1,1.1,.5), "Really Really red")
404
p.CFrame=tbl.CFrame*cn(rad*sn(i), 0, rad*cs(i))
405
p.CFrame=CFrame.new(p.CFrame.p, tbl.CFrame.p)
406
stick(p, base)
407
end
408
atfr=function(cf)
409
tfrw.C1=cn(3,.25,-4.5)*ca(0,0,pi/2)*cf
410
end
411
atfl=function(cf)
412
tflw.C1=cn(-3,.25,-4.5)*ca(0,0,pi/2)*cf
413
end
414
atbr=function(cf)
415
tblw.C1=cn(3,.25,4.5)*ca(0,0,pi/2)*cf
416
end
417
atbl=function(cf)
418
tblw.C1=cn(-3,.25,4.5)*ca(0,0,pi/2)*cf
419
end
420
local trunkw=weld(trunk, bf4, cn(0, .6, 1.25))
421
--SEATS
422
--DOOR
423
local DoorRight=Instance.new("Model", delorean)
424
local djr=part(DoorRight, false, false, vc(1, 1, 1), "Really Really red", 1)
425
local djrw=weld(djr, mainjoint, cn(1,0,0)*ca(0,0,0))
426
local dp=part(DoorRight, false, true, vc(2, .5, 2), "Really Really red")
427
local dpw=weld(dp, djr, cn(1, 0, 0))
428
local dp2=part(DoorRight, false, true, vc(.5, .5, 3.25), "Really Really red")
429
local dp2w=weld(dp2, dp, cn(1, -1, -2)*ca(rd(-45),rd(-10),0))
430
local dp3=part(DoorRight, false, true, vc(.5, 2.2, .5), "Really Really red")
431
local dp3w=weld(dp3, dp, cn(1, -.85, .75)*ca(0, 0, rd(15)))
432
local dw=wedge(DoorRight, false, true, vc(.5, 2, 1), "Really Really red")
433
local dww=weld(dw, dp, cn(1.25, -2.75, .5)*ca(pi,0,0))
434
local dw=wedge(DoorRight, false, true, vc(.5,1,.5), "Really Really red")
435
local dww=weld(dw, dp, cn(1.25, -3.25, -2.75)*ca(pi, pi, 0))
436
local dp4=part(DoorRight, false, true, vc(.5,1,.5), "Really Really red")
437
local dp4w=weld(dp4, dp, cn(1.25, -2.25, -2.75))
438
local dp5=part(DoorRight, false, true, vc(.5,2,2.5), "Really Really red")
439
local dp5w=weld(dp5, dp, cn(1.25, -2.75, -1.25))
440
local dwindow=wedge(DoorRight, false, true, vc(.25, 2, 2), "Really Really red", .5)
441
local dwindoww=weld(dwindow, dp, cn(1, -1, -1.75)*ca(0, 0, rd(15)))
442
local dwindow=part(DoorRight, false, true, vc(.25, 2, 1.5), "Really Really red", .5)
443
local dwindoww=weld(dwindow, dp, cn(1, -1, 0)*ca(0, 0, rd(15)))
444
local glass=part(DoorRight, false, true, vc(1, .5, .2), "Really Really red")
445
local glassw=weld(glass, dp, cn(1.5, -1.5, -2)*ca(0, rd(-35), 0))
446
local actr=false
447
local debr=false
448
function clickr()
449
if actr==false then
450
if debr==false then
451
debr=true
452
for i=0, 1, .1 do
453
djrw.C1=cn(1,0,0)*ca(0,0,rd(90)*i)
454
wait()
455
end
456
debr=false
457
actr=true
458
end
459
elseif actr==true then
460
if debr==false then
461
debr=true
462
for i=1, 0, -.1 do
463
djrw.C1=cn(1,0,0)*ca(0,0,rd(90)*i)
464
wait()
465
end
466
debr=false
467
actr=false
468
end
469
end
470
end
471
for i, v in pairs(DoorRight:children()) do
472
local cdetector=Instance.new("ClickDetector", v)
473
cdetector.MouseClick:connect(clickr)
474
end
475
local DoorLeft=Instance.new("Model", delorean)
476
local djl=part(DoorLeft, false, false, vc(1, 1, 1), "Really Really red", 1)
477
local djlw=weld(djl, mainjoint, cn(-1,0,0))
478
local dp=part(DoorLeft, false, true, vc(2, .5, 2), "Really Really red")
479
local dpw=weld(dp, djl, cn(-1, 0, 0))
480
local dp2=part(DoorLeft, false, true, vc(.5, .5, 3.25), "Really Really red")
481
local dp2w=weld(dp2, dp, cn(-1, -1, -2)*ca(rd(-45),rd(10),0))
482
local dp3=part(DoorLeft, false, true, vc(.5, 2.2, .5), "Really Really red")
483
local dp3w=weld(dp3, dp, cn(-1, -.85, .75)*ca(0, 0, rd(-15)))
484
local dw=wedge(DoorLeft, false, true, vc(.5, 2, 1), "Really Really red")
485
local dww=weld(dw, dp, cn(-1.25, -2.75, .5)*ca(pi,0,0))
486
local dw=wedge(DoorLeft, false, true, vc(.5,1,.5), "Really Really red")
487
local dww=weld(dw, dp, cn(-1.25, -3.25, -2.75)*ca(pi, pi, 0))
488
local dp4=part(DoorLeft, false, true, vc(.5,1,.5), "Really Really red")
489
local dp4w=weld(dp4, dp, cn(-1.25, -2.25, -2.75))
490
local dp5=part(DoorLeft, false, true, vc(.5,2,2.5), "Really Really red")
491
local dp5w=weld(dp5, dp, cn(-1.25, -2.75, -1.25))
492
local dwindow=wedge(DoorLeft, false, true, vc(.25, 2, 2), "Really Really red", .5)
493
local dwindoww=weld(dwindow, dp, cn(-1, -1, -1.75)*ca(0, 0, rd(-15)))
494
local dwindow=part(DoorLeft, false, true, vc(.25, 2, 1.5), "Really Really red", .5)
495
local dwindoww=weld(dwindow, dp, cn(-1, -1, 0)*ca(0, 0, rd(-15)))
496
local glass=part(DoorLeft, false, true, vc(1, .5, .2), "Really Really red")
497
local glassw=weld(glass, dp, cn(-1.5, -1.5, -2)*ca(0, rd(35), 0))
498
local actl=false
499
local debl=false
500
function clickl()
501
if actl==false then
502
if debl==false then
503
debl=true
504
for i=0, 1, .1 do
505
djlw.C1=cn(-1,0,0)*ca(0,0,rd(-90)*i)
506
wait()
507
end
508
debl=false
509
actl=true
510
end
511
elseif actl==true then
512
if debl==false then
513
debl=true
514
for i=1, 0, -.1 do
515
djlw.C1=cn(-1,0,0)*ca(0,0,rd(-90)*i)
516
wait()
517
end
518
debl=false
519
actl=false
520
end
521
end
522
end
523
for i, v in pairs(DoorLeft:children()) do
524
local cdetector=Instance.new("ClickDetector", v)
525
cdetector.MouseClick:connect(clickl)
526
end
527
local bf=Instance.new("BodyForce")
528
local bav=Instance.new("BodyAngularVelocity") bav.angularvelocity=vc(0,0,0) bav.maxTorque=vc(math.huge,math.huge,math.huge)
529
local vs=Instance.new("VehicleSeat", delorean)
530
vs.HeadsUpDisplay=false
531
vs.CanCollide=false
532
vs.Transparency=1
533
vs.Size=Vector3.new(2, .5, 2)
534
weld(vs, base, cn(-1.5, 0, 1))
535
local ps=Instance.new("VehicleSeat", delorean)
536
ps.HeadsUpDisplay=false
537
ps.CanCollide=false
538
ps.Size=Vector3.new(2, .5, 2)
539
ps.Transparency=1
540
weld(ps, base, cn(1.5, 0, 1))
541
torsos={}
542
ps.ChildAdded:connect(function(w)
543
if w.Name=="SeatWeld" then
544
torso=w.Part1
545
if torso then
546
        for i, v2 in pairs(torso.Parent:children()) do
547
                if v2:isA("BasePart") then
548
                        for i, v3 in pairs(v2:children()) do
549
                                if v3:isA("CFrameValue") then
550
                                        v3:remove() 
551
                                end
552
                        end
553
                end
554
        end
555
end
556
table.insert(torsos, torso)
557
w.C1=w.C1*CFrame.new(0, 0, .5)
558
end
559
end)
560
running=false
561
vs.ChildAdded:connect(function(w)
562
if w.Name=="SeatWeld" then
563
torso=w.Part1
564
w.C1=w.C1*CFrame.new(0, 0, .5)
565
if torso then
566
        for i, v2 in pairs(torso.Parent:children()) do
567
                if v2:isA("BasePart") then
568
                        for i, v3 in pairs(v2:children()) do
569
                                if v3:isA("CFrameValue") then
570
                                        v3:remove() 
571
                                end
572
                        end
573
                end
574
        end
575
table.insert(torsos, torso)
576
local player=game.Players:getPlayerFromCharacter(torso.Parent)
577
screengui=Instance.new("ScreenGui", player.PlayerGui) screengui.Name=modelname
578
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))
579
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))
580
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))
581
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))
582
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))
583
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))
584
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))
585
running=true
586
run()
587
end
588
end
589
end)
590
vs.ChildRemoved:connect(function(w)
591
if w.Name=="SeatWeld" then
592
torso=w.Part1
593
if torso then
594
for i, v in pairs(torsos) do
595
        if v==torso then
596
                table.remove(torsos,i)
597
        end
598
end
599
local player=game.Players:getPlayerFromCharacter(torso.Parent)
600
player.PlayerGui[modelname]:remove()
601
running=false
602
end
603
end
604
end)
605
ps.ChildRemoved:connect(function(w)
606
if w.Name=="SeatWeld" then
607
torso=w.Part1
608
if torso then
609
for i, v in pairs(torsos) do
610
        if v==torso then
611
                table.remove(torsos,i)
612
        end
613
end
614
end
615
end
616
end)
617
c(function()wait(.5) bp:remove()end)
618
function makelightning(from, to, thick, col)
619
local magnitude=(from.p-to.p).magnitude
620
local distance=(from.p+to.p)/2
621
local pattern=part(workspace, true, false, vc(.2, .2, magnitude), "White", 1, cn(distance, from.p))
622
local fromPosProx=from.p
623
for i=1, 4 do
624
local fromPosProx2=fromPosProx
625
local random=vc(rn(-1, 1), rn(-1, 1), rn(-1, 1))
626
local findSize=pattern.Size.z/3
627
local findOffSet=pattern.CFrame.lookVector*-1
628
local compute=i*findSize*findOffSet
629
local newfromPos=from.p
630
local newEndPos=cn(random+compute+newfromPos).p
631
local magnitude=(fromPosProx2-newEndPos).magnitude
632
local distance=(fromPosProx2+newEndPos)/2
633
local lightning=part(workspace, true, false, vc(1, 1, 1), col or "Bright yellow", 0, cn(distance, fromPosProx2), vc(thick, thick, magnitude))
634
fromPosProx=newEndPos
635
game.Debris:addItem(lightning, .5)
636
end 
637
pattern:remove()
638
end
639
function play(soundid, pitch, volume)
640
local sound=sound(workspace, soundid, pitch, volume)
641
sound:play()
642
c(function() wait(5) sound:remove() end)
643
end
644
trm=Instance.new("Model", delorean)
645
function trail(prt, cf, thick, col)
646
local old=(prt.CFrame*(cf or cn())).p
647
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))
648
c(function()
649
for i=1, 0, -.001 do pc(function() trail.Mesh.Scale=trail.Mesh.Scale*vc(i, i, i) end) wait() end
650
trail:remove()
651
end)
652
end
653
Targets={}
654
timedeb=false
655
num=0
656
maxnum=400
657
origin=0
658
function stick(from, to)
659
local stickW=weld(from, to, to.CFrame:inverse()*from.CFrame)
660
stickW.C0=from.CFrame:inverse()*from.CFrame
661
return stickW
662
end
663
local bp=Instance.new("BodyPosition") bp.D=100 bp.maxForce=vc(inf,inf,inf)
664
timedeb=false
665
function run()
666
num=0
667
c(function()
668
for i, v in pairs(workspace:children()) do
669
        if v:isA("Model") then
670
                for i, v2 in pairs(v:children()) do
671
                        if v2:isA("BasePart") then
672
                                for i, v3 in pairs(v2:children()) do
673
                                        if v3:isA("CFrameValue") then
674
                                                v3:remove() 
675
                                        end
676
                                end
677
                        end
678
                end
679
        end
680
end
681
timedeb=true
682
while true do
683
--TimeContinium-----------------------------
684
if num<=0 and timedeb==true then
685
        for i, v in pairs(workspace:children()) do
686
                if v:isA("BasePart") then
687
                        if v.Anchored==false then
688
                                table.insert(Targets, v)
689
                                local Origin = Instance.new("CFrameValue")
690
                                Origin.Parent = v
691
                                Origin.Name = "Origin CFrame"
692
                                Origin.Value = v.CFrame
693
                        end
694
                end
695
                for i, t in pairs(torsos) do
696
                        if v:isA("Model") and v~=t.Parent and v~=delorean then
697
                                for i, v2 in pairs(v:children()) do
698
                                        if v2:isA("BasePart") then
699
                                                table.insert(Targets, v2)
700
                                                local Origin = Instance.new("CFrameValue")
701
                                                Origin.Parent = v2
702
                                                Origin.Name = "Origin CFrame"
703
                                                Origin.Value = v2.CFrame
704
                                        end
705
                                end
706
                        end
707
                end
708
        end
709
---------
710
while num<maxnum and timedeb==true do ---print(num)
711
        for i, v in pairs(workspace:children()) do
712
                if v:isA("BasePart") and v:findFirstChild("Origin CFrame")==nil then
713
                        if v.Anchored==false then
714
                                table.insert(Targets, v)
715
                                local Origin = Instance.new("CFrameValue")
716
                                Origin.Parent = v
717
                                Origin.Name = "Origin CFrame"
718
                                Origin.Value = v.CFrame
719
                        end
720
                end
721
                for i, t in pairs(torsos) do
722
                        if v:isA("Model") and v~=t.Parent and v~=delorean then
723
                                for i, v2 in pairs(v:children()) do
724
                                        if v2:isA("BasePart") and v2:findFirstChild("Origin CFrame")==nil then
725
                                                table.insert(Targets, v2)
726
                                                local Origin = Instance.new("CFrameValue")
727
                                                Origin.Parent = v2
728
                                                Origin.Name = "Origin CFrame"
729
                                                Origin.Value = v2.CFrame
730
                                        end
731
                                end
732
                        end
733
                end
734
        end
735
for i, v in pairs(Targets) do
736
local History = Instance.new("CFrameValue") 
737
History.Parent = v 
738
History.Name = num
739
History.Value = v.CFrame 
740
end 
741
num = num + 1 
742
wait()
743
end
744
end
745
wait()
746
end
747
end)
748
while running do
749
local speed=base.Velocity.magnitude
750
speedometer.Text=math.floor(speed)
751
if speed>65 and speed<88 then play("http://www.roblox.com/asset/?id=2800815", 1, .5)
752
makelightning(base.CFrame*CFrame.new(0,0,10), base.CFrame*CFrame.new(rn(-10,10),rn(-10,10),rn(-2,10)), 1)
753
trail(tbr,cn(-1.5, 0, -10),2.5,"Bright orange")
754
trail(tbl,cn(-1.9, 0, -10),2.5,"Bright orange")
755
end
756
if speed>88 and speed<90 then play("http://roblox.com/asset/?id=10209481")
757
local trm2=trm:clone() trm2.Parent=workspace
758
origin=base.Position
759
print(origin)
760
game.Debris:addItem(trm2, 5)
761
bp.position=vc(0,0,-99999)
762
bp.Parent=base
763
timedeb=false
764
c(function()
765
for i=0,1,.005 do
766
game.Lighting.TimeOfDay=math.floor(hourbox.Text*i)..":"..math.floor(minutebox.Text*i)..":"..math.floor(secondbox.Text*i)
767
wait()
768
end
769
end)
770
while num > 0 do --print(num)
771
wait()
772
num = num - 1
773
for i, v in pairs(Targets) do
774
v.Anchored=true
775
local History = v:findFirstChild(num)
776
if History ~= nil then
777
v.CFrame = History.Value
778
History:remove()
779
end
780
end
781
end
782
for i, v in pairs(Targets) do
783
local Origin = v:findFirstChild("Origin CFrame")
784
if Origin ~= nil then
785
v.CFrame = Origin.Value
786
v:makeJoints()
787
Origin:remove()
788
end
789
end
790
for i, v in pairs(Targets) do
791
v.Anchored=false
792
end
793
play("http://www.roblox.com/asset/?id=2101148", 1, 1)
794
exp=Instance.new("Explosion", workspace)
795
exp.BlastPressure=0
796
exp.Position=origin
797
Targets = {}
798
timedeb=true
799
bp.position=origin
800
origin=0
801
base.Velocity=vc(0,0,0)
802
bf.force=base.CFrame.lookVector*0
803
wait(1)
804
bp:remove()
805
end
806
if vs.Steer==0 then bav.angularvelocity=vc(0,0,0) atfr(ca(0, 0, 0)) atfl(ca(0, 0, 0)) end
807
if vs.Steer==1 then atfr(ca(rd(-25), 0, 0)) atfl(ca(rd(-25), 0, 0)) end
808
if vs.Steer==-1 then atfr(ca(rd(25), 0, 0)) atfl(ca(rd(25), 0, 0)) end
809
if vs.Throttle==1 then bav.Parent=base bf.Parent=base
810
if vs.Steer==1 then bav.angularvelocity=vc(0,-2,0) end
811
if vs.Steer==-1 then bav.angularvelocity=vc(0,2,0) end
812
bf.force=base.CFrame.lookVector*40000
813
end
814
if vs.Throttle==0 then bav.Parent=base bf.Parent=base
815
bf.force=base.CFrame.lookVector*0
816
end
817
if vs.Throttle==-1 then bav.Parent=base bf.Parent=base
818
if vs.Steer==1 then bav.angularvelocity=vc(0,2,0) end
819
if vs.Steer==-1 then bav.angularvelocity=vc(0,-2,0) end
820
bf.force=base.CFrame.lookVector*-40000
821
end
822
wait()
823
end
824
end