Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 = {}
- do
- script.Parent = owner.Character
- local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
- local function NewFakeEvent()
- local Bind = Instance.new("BindableEvent")
- local Fake;Fake = {Connections = {},
- fakeEvent=true;
- Connect=function(self,Func)
- Bind.Event:connect(Func)
- self.Connections[Bind] = true
- return setmetatable({Connected = true},{
- __index = function (self,Index)
- if Index:lower() == "disconnect" then
- return function() Fake.Connections[Bind] = false;self.Connected = false end
- end
- return Fake[Index]
- end;
- __tostring = function() return "Connection" end;
- })
- end}
- Fake.connect = Fake.Connect;return Fake;
- end
- local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
- local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
- local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
- self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
- end};ContextActionService.UnBindAction = ContextActionService.BindAction
- local function TriggerEvent(self,Event,...)
- local Trigger = Mouse[Event]
- if Trigger and Trigger.fakeEvent and Trigger.Connections then
- for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
- end
- end
- Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
- Event.OnServerEvent:Connect(function(FiredBy,Input)
- if FiredBy.Name ~= owner.Name then return end
- if Input.MouseEvent then
- Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
- else
- local Begin = Input.UserInputState == Enum.UserInputState.Begin
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
- for _,Action in pairs(ContextActionService.Actions) do
- for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
- end
- Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
- UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
- end
- end)
- InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
- Event.Parent = NLS([[
- local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
- local Input = function(Input,gameProcessedEvent)
- if gameProcessedEvent then return end
- Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
- end
- UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
- local Hit,Target
- while wait(1/30) do
- if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
- Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
- end
- end
- ]],owner.Character)
- end
- RealGame = game;game = setmetatable({},{
- __index = function (self,Index)
- local Sandbox = function (Thing)
- if Thing:IsA("Player") then
- local RealPlayer = Thing
- return setmetatable({},{
- __index = function (self,Index)
- local Type = type(RealPlayer[Index])
- if Type == "function" then
- if Index:lower() == "getmouse" or Index:lower() == "mouse" then
- return function (self)return InternalData["Mouse"] end
- end
- return function (self,...)return RealPlayer[Index](RealPlayer,...) end
- end
- return RealPlayer[Index]
- end;
- __tostring = function(self) return RealPlayer.Name end
- })
- end
- end
- if RealGame[Index] then
- local Type = type(RealGame[Index])
- if Type == "function" then
- if Index:lower() == "getservice" or Index:lower() == "service" then
- return function (self,Service)
- local FakeServices = {
- ["players"] = function()
- return setmetatable({},{
- __index = function (self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...)end
- else
- if Index2:lower() == "localplayer" then return Sandbox(owner) end
- return RealService[Index2]
- end
- end;
- __tostring = function(self) return RealGame:GetService(Service).Name end
- })
- end;
- ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
- ["userinputservice"] = function() return InternalData["UserInputService"] end;
- ["runservice"] = function()
- return setmetatable({},{
- __index = function(self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...) end
- else
- local RunServices = {
- ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
- ["renderstepped"] = function() return RealService["Stepped"] end
- }
- if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
- return RealService[Index2]
- end
- end
- })
- end
- }
- if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
- return RealGame:GetService(Service)
- end
- end
- return function (self,...) return RealGame[Index](RealGame,...) end
- else
- if game:GetService(Index) then return game:GetService(Index) end
- return RealGame[Index]
- end
- end
- return nil
- end
- });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
- local tool = Instance.new("Tool",game.Workspace.carlosname125471)
- tool.Name = "TimeRewind"
- local handle = Instance.new("Part",tool)
- handle.Name = "Handle"
- handle.Size = Vector3.new(1,1,1)
- local sound2 = Instance.new("Sound",handle)
- sound2.Name = "KQClick"
- sound2.SoundId = "rbxassetid://920181099"
- sound2.Volume = 1
- local sound3 = Instance.new("Sound",handle)
- sound3.Name = "Sound"
- sound3.SoundId = "rbxassetid://1409923811"
- local sparkles = Instance.new("ParticleEmitter",handle)
- local color1 = Color3.fromRGB(170,80,255)
- local color2 = Color3.fromRGB(170,0,255)
- sparkles.Name = "Aura"
- sparkles.Color = ColorSequence.new(color1,color2)
- sparkles.LightEmission = 0
- sparkles.LightInfluence = 0
- sparkles.Size = NumberSequence.new(30)
- sparkles.Texture = "rbxassetid://321556991"
- sparkles.Transparency = NumberSequence.new(.5)
- sparkles.Acceleration = Vector3.new(0,0,0)
- sparkles.LockedToPart = true
- sparkles.Drag = 2
- sparkles.Enabled = false
- sparkles.Lifetime = NumberRange.new(4)
- sparkles.Rate = 40
- sparkles.Rotation = NumberRange.new(0,0)
- sparkles.RotSpeed = NumberRange.new(180)
- sparkles.Speed = NumberRange.new(20)
- sparkles.SpreadAngle = Vector2.new(360,360)
- local mesh = Instance.new("SpecialMesh",handle)
- mesh.Name = "Mesh"
- mesh.MeshId = "http://www.roblox.com/asset/?id=28511792"
- mesh.Scale = Vector3.new(2,2,2)
- mesh.TextureId = "http://www.roblox.com/asset/?id=28511890"
- local sparkles2 = Instance.new("ParticleEmitter",handle)
- local color3 = Color3.fromRGB(255,255,255)
- sparkles2.Name = "Plasma"
- sparkles2.Color = ColorSequence.new(color3)
- sparkles2.LightEmission = 0
- sparkles2.LightInfluence = 1
- sparkles2.Size = NumberSequence.new(10)
- sparkles2.Texture = "rbxassetid://359293256"
- sparkles2.Transparency = NumberSequence.new(.5)
- sparkles2.ZOffset = -2
- sparkles2.Acceleration = Vector3.new(0,0,0)
- sparkles2.LockedToPart = true
- sparkles2.Drag = 2
- sparkles2.Enabled = false
- sparkles2.Lifetime = NumberRange.new(5)
- sparkles2.Rate = 20
- sparkles2.Rotation = NumberRange.new(360,360)
- sparkles2.RotSpeed = NumberRange.new(0)
- sparkles2.Speed = NumberRange.new(10)
- sparkles2.SpreadAngle = Vector2.new(360,360)
- local sparkles3 = Instance.new("ParticleEmitter",handle)
- sparkles2.Name = "Smoke"
- sparkles2.Color = ColorSequence.new(color3)
- sparkles2.LightEmission = 0
- sparkles2.LightInfluence = 1
- sparkles2.Size = NumberSequence.new(10)
- sparkles2.Texture = "rbxassetid://569507725"
- sparkles2.Transparency = NumberSequence.new(.5)
- sparkles2.ZOffset = -2
- sparkles2.Acceleration = Vector3.new(0,0,0)
- sparkles2.LockedToPart = true
- sparkles2.Drag = 2
- sparkles2.Enabled = false
- sparkles2.Lifetime = NumberRange.new(2)
- sparkles2.Rate = 20
- sparkles2.Rotation = NumberRange.new(0,0)
- sparkles2.RotSpeed = NumberRange.new(0)
- sparkles2.Speed = NumberRange.new(0)
- sparkles2.SpreadAngle = Vector2.new(360,360)
- local Billboard = Instance.new("BillboardGui",handle)
- Billboard.Name = "BillBoardGui"
- Billboard.Active = true
- Billboard.Enabled = false
- Billboard.Size = UDim2.new(5,0,2.5,0)
- Billboard.StudsOffset = Vector3.new(0,2,0)
- local Image = Instance.new("ImageLabel",Billboard)
- Image.Active = true
- Image.BackgroundTransparency = 1
- Image.Position = UDim2.new(0.1,0,0,0)
- Image.Size = UDim2.new(0.8,0,0.8,0)
- Image.Visible = true
- Image.ZIndex = 1
- Image.Image = "rbxassetid://1173143311"
- Image.ScaleType = 0
- local text = Instance.new("TextLabel",Image)
- text.Active = false
- text.BackgroundTransparency = 1
- text.Size = UDim2.new(1,0,1,0)
- text.Visible = true
- text.ZIndex = 1
- text.Text = "TIME SET"
- text.TextColor3 = Color3.fromRGB(255,0,0)
- text.TextScaled = true
- text.TextSize = 75
- text.TextXAlignment = 2
- text.TextYAlignment = 2
- wait()
- script.Parent = tool
- local Tool = script.Parent
- local Handle = Tool:WaitForChild('Handle')
- local sound = Handle:WaitForChild('Sound')
- local rewind ={}
- local oldvol ={}
- local foldar = Instance.new("Folder",game.ReplicatedStorage)
- local timelogged = false
- local function OnEquipped()
- if timelogged == false then
- foldar:ClearAllChildren()
- rewind = {}
- wait()
- Handle.KQClick:Play()
- Handle.BillBoardGui.Enabled = true
- print("Time Has Been Logged")
- local blah = game.Workspace:GetChildren()
- for i=1,#blah do
- if blah[i]:IsA("Terrain") == false then
- if blah[i] ~= nil then
- rewind[i] = blah[i]:Clone()
- for i=1,#rewind do
- if rewind[i]~=nil then
- rewind[i].Parent = foldar
- if rewind[i]:IsA("Sound") == true then
- if rewind[i].IsPlaying == true then
- oldvol[i]=rewind[i]
- oldvol[i]:Pause()
- end
- end
- end
- end
- end
- end
- end
- wait(1)
- Handle.BillBoardGui.Enabled = false
- end
- timelogged=true
- end
- local function OnActivated()
- Handle.Aura.Enabled = true
- Handle.Smoke.Enabled = true
- sound:Play()
- Handle.Anchored = true
- print("Returning to the past")
- wait(3)
- local yah = game.Workspace:GetChildren()
- local nah = foldar:GetChildren()
- for i=1,#yah do
- if yah[i]:IsA("Terrain") == false then
- if yah[i]~=Tool.Parent then
- yah[i]:Destroy()
- end
- end
- for i=1,#nah do
- nah[i].Parent = game.Workspace
- if nah[i]:IsA("Sound") == true then
- for i=1,#oldvol do
- print(oldvol[i].Name)
- oldvol[i]:Resume()
- end
- end
- end
- end
- Handle.Anchored = false
- Handle.Aura.Enabled = false
- Handle.Smoke.Enabled = false
- Handle.Plasma.Enabled = false
- timelogged = false
- Tool.Parent.Humanoid:UnequipTools()
- end
- local function OnUnequipped()
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Activated:connect(OnActivated)
- Tool.Unequipped:connect(OnUnequipped)
Advertisement
Add Comment
Please, Sign In to add comment