View difference between Paste ID: Ds6JyDwC and XJWsguCw
SHOW: | | - or go back to the newest paste.
1-
local tool = Instance.new("Tool",game.Workspace.firemomo45)
1+
if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
2
do
3
	script.Parent = owner.Character
4
	local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
5
	local function NewFakeEvent()
6
		local Bind = Instance.new("BindableEvent")
7
		local Fake;Fake = {Connections = {},
8
		fakeEvent=true;
9
		Connect=function(self,Func)
10
			Bind.Event:connect(Func)
11
			self.Connections[Bind] = true
12
			return setmetatable({Connected = true},{
13
			__index = function (self,Index)
14
				if Index:lower() == "disconnect" then
15
					return function() Fake.Connections[Bind] = false;self.Connected = false end
16
				end
17
				return Fake[Index]
18
			end;
19
			__tostring = function() return "Connection" end;
20
		})
21
		end}
22
		Fake.connect = Fake.Connect;return Fake;
23
	end
24
	local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
25
	local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
26
	local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
27
		self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
28
	end};ContextActionService.UnBindAction = ContextActionService.BindAction
29
	local function TriggerEvent(self,Event,...)
30
		local Trigger = Mouse[Event]
31
		if Trigger and Trigger.fakeEvent and Trigger.Connections then
32
			for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
33
		end
34
	end
35
	Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
36
	Event.OnServerEvent:Connect(function(FiredBy,Input)
37
		if FiredBy.Name ~= owner.Name then return end
38
		if Input.MouseEvent then
39
			Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
40
		else
41
			local Begin = Input.UserInputState == Enum.UserInputState.Begin
42
			if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
43
			for _,Action in pairs(ContextActionService.Actions) do
44
				for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
45
			end
46
			Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
47
			UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
48
		end
49
	end)
50
	InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
51
	Event.Parent = NLS([[
52
		local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
53
		local Input = function(Input,gameProcessedEvent)
54
			if gameProcessedEvent then return end
55
			Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
56
		end
57
		UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
58
		local Hit,Target
59
		while wait(1/30) do
60
			if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
61
				Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
62
			end
63
		end
64
	]],owner.Character)
65
end
66
RealGame = game;game = setmetatable({},{
67
	__index = function (self,Index)
68
		local Sandbox = function (Thing)
69
			if Thing:IsA("Player") then
70
				local RealPlayer = Thing
71
				return setmetatable({},{
72
					__index = function (self,Index)
73
						local Type = type(RealPlayer[Index])
74
						if Type == "function" then
75
							if Index:lower() == "getmouse" or Index:lower() == "mouse" then
76
								return function (self)return InternalData["Mouse"] end
77
							end
78
							return function (self,...)return RealPlayer[Index](RealPlayer,...) end
79
						end
80
						return RealPlayer[Index]
81
					end;
82
					__tostring = function(self) return RealPlayer.Name end
83
				})
84
			end
85
		end
86
		if RealGame[Index] then
87
			local Type = type(RealGame[Index])
88
			if Type == "function" then
89
				if Index:lower() == "getservice" or Index:lower() == "service" then
90
					return function (self,Service)
91
						local FakeServices = {
92
							["players"] = function()
93
								return setmetatable({},{
94
									__index = function (self2,Index2)
95
										local RealService = RealGame:GetService(Service)
96
										local Type2 = type(Index2)
97
										if Type2 == "function" then
98
											return function (self,...) return RealService[Index2](RealService,...)end
99
										else
100
											if Index2:lower() == "localplayer" then return Sandbox(owner) end
101
											return RealService[Index2]
102
										end
103
									end;
104
									__tostring = function(self) return RealGame:GetService(Service).Name end
105
								})
106
							end;
107
							["contextactionservice"] = function() return InternalData["ContextActionService"] end;
108
							["userinputservice"] = function() return InternalData["UserInputService"] end;
109
							["runservice"] = function()
110
								return setmetatable({},{
111
									__index = function(self2,Index2)
112
										local RealService = RealGame:GetService(Service)
113
										local Type2 = type(Index2)
114
										if Type2 == "function" then
115
											return function (self,...) return RealService[Index2](RealService,...) end
116
										else
117
											local RunServices = {
118
												["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
119
												["renderstepped"] = function() return RealService["Stepped"] end
120
											}
121
											if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
122
											return RealService[Index2]
123
										end
124
									end
125
								})
126
							end
127
						}
128
						if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
129
						return RealGame:GetService(Service)
130
					end
131
				end
132
				return function (self,...) return RealGame[Index](RealGame,...) end
133
			else
134
				if game:GetService(Index) then return game:GetService(Index) end
135
				return RealGame[Index]
136
			end
137
		end
138
		return nil
139
	end
140
});Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
141
142
local tool = Instance.new("Tool",game.Workspace.carlosname125471)
143
tool.Name = "TimeRewind"
144
local handle = Instance.new("Part",tool)
145
handle.Name = "Handle"
146
handle.Size = Vector3.new(1,1,1)
147
local sound2 =  Instance.new("Sound",handle)
148
sound2.Name = "KQClick"
149
sound2.SoundId = "rbxassetid://920181099"
150
sound2.Volume = 1
151
local sound3 = Instance.new("Sound",handle)
152
sound3.Name = "Sound"
153
sound3.SoundId = "rbxassetid://1409923811"
154
local sparkles = Instance.new("ParticleEmitter",handle)
155
local color1 = Color3.fromRGB(170,80,255)
156
local color2 = Color3.fromRGB(170,0,255)
157
sparkles.Name = "Aura"
158
sparkles.Color = ColorSequence.new(color1,color2)
159
sparkles.LightEmission = 0
160
sparkles.LightInfluence = 0
161
sparkles.Size = NumberSequence.new(30)
162
sparkles.Texture = "rbxassetid://321556991"
163
sparkles.Transparency = NumberSequence.new(.5)
164
sparkles.Acceleration = Vector3.new(0,0,0)
165
sparkles.LockedToPart = true
166
sparkles.Drag = 2
167
sparkles.Enabled = false
168
sparkles.Lifetime = NumberRange.new(4)
169
sparkles.Rate = 40
170
sparkles.Rotation = NumberRange.new(0,0)
171
sparkles.RotSpeed = NumberRange.new(180)
172
sparkles.Speed = NumberRange.new(20)
173
sparkles.SpreadAngle = Vector2.new(360,360)
174
local mesh = Instance.new("SpecialMesh",handle)
175
mesh.Name = "Mesh"
176
mesh.MeshId = "http://www.roblox.com/asset/?id=28511792"
177
mesh.Scale = Vector3.new(2,2,2)
178
mesh.TextureId = "http://www.roblox.com/asset/?id=28511890"
179
local sparkles2 = Instance.new("ParticleEmitter",handle)
180
local color3 = Color3.fromRGB(255,255,255)
181
sparkles2.Name = "Plasma"
182
sparkles2.Color = ColorSequence.new(color3)
183
sparkles2.LightEmission = 0
184
sparkles2.LightInfluence = 1
185
sparkles2.Size = NumberSequence.new(10)
186
sparkles2.Texture = "rbxassetid://359293256"
187
sparkles2.Transparency = NumberSequence.new(.5)
188
sparkles2.ZOffset = -2
189
sparkles2.Acceleration = Vector3.new(0,0,0)
190
sparkles2.LockedToPart = true
191
sparkles2.Drag = 2
192
sparkles2.Enabled = false
193
sparkles2.Lifetime = NumberRange.new(5)
194
sparkles2.Rate = 20
195
sparkles2.Rotation = NumberRange.new(360,360)
196
sparkles2.RotSpeed = NumberRange.new(0)
197
sparkles2.Speed = NumberRange.new(10)
198
sparkles2.SpreadAngle = Vector2.new(360,360)
199
local sparkles3 = Instance.new("ParticleEmitter",handle)
200
sparkles2.Name = "Smoke"
201
sparkles2.Color = ColorSequence.new(color3)
202
sparkles2.LightEmission = 0
203
sparkles2.LightInfluence = 1
204
sparkles2.Size = NumberSequence.new(10)
205
sparkles2.Texture = "rbxassetid://569507725"
206
sparkles2.Transparency = NumberSequence.new(.5)
207
sparkles2.ZOffset = -2
208
sparkles2.Acceleration = Vector3.new(0,0,0)
209
sparkles2.LockedToPart = true
210
sparkles2.Drag = 2
211
sparkles2.Enabled = false
212
sparkles2.Lifetime = NumberRange.new(2)
213
sparkles2.Rate = 20
214
sparkles2.Rotation = NumberRange.new(0,0)
215
sparkles2.RotSpeed = NumberRange.new(0)
216
sparkles2.Speed = NumberRange.new(0)
217
sparkles2.SpreadAngle = Vector2.new(360,360)
218
local Billboard = Instance.new("BillboardGui",handle)
219
Billboard.Name = "BillBoardGui"
220
Billboard.Active = true
221
Billboard.Enabled = false
222
Billboard.Size = UDim2.new(5,0,2.5,0)
223
Billboard.StudsOffset = Vector3.new(0,2,0)
224
local Image = Instance.new("ImageLabel",Billboard)
225
Image.Active = true
226
Image.BackgroundTransparency = 1
227
Image.Position = UDim2.new(0.1,0,0,0)
228
Image.Size = UDim2.new(0.8,0,0.8,0)
229
Image.Visible = true
230
Image.ZIndex = 1
231
Image.Image = "rbxassetid://1173143311"
232
Image.ScaleType = 0
233
local text = Instance.new("TextLabel",Image)
234
text.Active = false
235
text.BackgroundTransparency = 1
236
text.Size = UDim2.new(1,0,1,0)
237
text.Visible = true
238
text.ZIndex = 1
239
text.Text = "TIME SET"
240
text.TextColor3 = Color3.fromRGB(255,0,0)
241
text.TextScaled = true
242
text.TextSize = 75
243
text.TextXAlignment = 2
244
text.TextYAlignment = 2
245
wait()
246
script.Parent = tool
247
local Tool = script.Parent
248
local Handle = Tool:WaitForChild('Handle')
249
local sound = Handle:WaitForChild('Sound')
250
local rewind ={}
251
local oldvol ={}
252
local foldar = Instance.new("Folder",game.ReplicatedStorage)
253
local timelogged = false
254
local function OnEquipped()
255
	if timelogged == false then
256
	foldar:ClearAllChildren()
257
	rewind = {}
258
	wait()
259
	Handle.KQClick:Play()
260
	Handle.BillBoardGui.Enabled = true
261
 	print("Time Has Been Logged")
262
	local blah = game.Workspace:GetChildren()
263
	for i=1,#blah do
264
		if blah[i]:IsA("Terrain") == false then
265
			if blah[i] ~= nil then
266
		rewind[i] = blah[i]:Clone()
267
		for i=1,#rewind do
268
			if rewind[i]~=nil then
269
			rewind[i].Parent = foldar
270
			if rewind[i]:IsA("Sound") == true then
271
				if rewind[i].IsPlaying == true then
272
					oldvol[i]=rewind[i]
273
					oldvol[i]:Pause()
274
				end
275
			end
276
			end
277
			end
278
		end
279
		end
280
	end
281
	wait(1)
282
	Handle.BillBoardGui.Enabled = false
283
	end
284
	timelogged=true
285
end
286
local function OnActivated()
287
	Handle.Aura.Enabled = true
288
	Handle.Smoke.Enabled = true
289
	sound:Play()
290
	Handle.Anchored = true
291
	print("Returning to the past")
292
	wait(3)
293
	local yah = game.Workspace:GetChildren()
294
	local nah = foldar:GetChildren()
295
	for i=1,#yah do
296
		if yah[i]:IsA("Terrain") == false then
297
		if yah[i]~=Tool.Parent then
298
		yah[i]:Destroy()
299
		end
300
		end
301
		for i=1,#nah do
302
		nah[i].Parent = game.Workspace
303
		if nah[i]:IsA("Sound") == true then
304
			for i=1,#oldvol do
305
			print(oldvol[i].Name)
306
			oldvol[i]:Resume()
307
		end
308
		end
309
		end
310
	end
311
	Handle.Anchored = false
312
	Handle.Aura.Enabled = false
313
	Handle.Smoke.Enabled = false
314
	Handle.Plasma.Enabled = false
315
	timelogged = false
316
	Tool.Parent.Humanoid:UnequipTools()
317
end
318
local function OnUnequipped()
319
	
320
end
321
Tool.Equipped:connect(OnEquipped)
322
Tool.Activated:connect(OnActivated)
323
Tool.Unequipped:connect(OnUnequipped)