Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- local plr = owner
- local deb = false
- while not plr.Character do wait() end
- wait(0.1)
- warn("Timestop loaded. R to toggle time.")
- local tstab = {}
- local tsstab = {}
- local ignlist = {}
- local stab = {}
- function plrIgnore(char)
- for i,v in pairs(char:GetChildren()) do
- if #v:GetChildren() >= 1 then
- plrIgnore(v)
- end
- table.insert(ignlist,v)
- end
- end
- function timeStop(target)
- for i,v in pairs(target:GetChildren()) do
- if #v:GetChildren() >= 1 then
- timeStop(v)
- end
- local isinign = false
- for i,b in pairs(ignlist) do
- if b == v then
- isinign = true
- end
- end
- if isinign == false then
- if v:IsA("Part") or v:IsA("WedgePart") or v:IsA("UnionOperation") then
- if v.Anchored == false then
- table.insert(tstab,v)
- v.Anchored = true
- end
- end
- if v:IsA("Sound") then
- local isintab = false
- for i,b in pairs(stab) do
- if v == b[1] then
- isintab = true
- end
- end
- if isintab == false then
- table.insert(stab,{v,v.Pitch})
- end
- end
- --[[if v:IsA("Script") or v:IsA("LocalScript") then
- if v.Disabled == false then
- table.insert(tsstab,v)
- v.Disabled = true
- end
- end]]
- end
- end
- local isinign = false
- for i,b in pairs(ignlist) do
- if b == target then
- isinign = true
- end
- end
- if isinign == false then
- if target:IsA("Part") or target:IsA("WedgePart") or target:IsA("UnionOperation") then
- if target.Anchored == false then
- table.insert(tstab,target)
- target.Anchored = true
- end
- end
- if target:IsA("Sound") then
- table.insert(stab,{target,target.Pitch})
- end
- end
- end
- plr:GetMouse().KeyDown:connect(function(key)
- if key == "r" then
- if deb == true then
- deb = false
- else
- deb = true
- local cc = Instance.new("ColorCorrectionEffect",game:GetService("Lighting"))
- spawn(function()
- plr.Character.Humanoid.WalkSpeed = 0
- plr.Character.Humanoid.JumpPower = 0
- local p = Instance.new("Part",plr.Character)
- p.Transparency = 0.5
- p.BrickColor = BrickColor.new("Institutional white")
- p.Size = Vector3.new(0.2,0.2,0.2)
- p.Anchored = true
- p.CanCollide = false
- p.CFrame = plr.Character.Torso.CFrame
- local m = Instance.new("SpecialMesh",p)
- m.MeshType = Enum.MeshType.Sphere
- local r = 255
- local g = 255
- local b = 255
- local contrast = 0
- for i=1,50 do
- m.Scale = m.Scale + Vector3.new(50,50,50)
- p.Transparency = p.Transparency + 0.5/50
- r = r - ((255-42)/50)
- g = g - ((255-0)/50)
- b = b - ((255-255)/50)
- contrast = contrast - 2/50
- --cc.TintColor = Color3.fromRGB(r,g,b)
- cc.Contrast = contrast
- for i,v in pairs(stab) do
- v[1].Pitch = v[1].Pitch - (v[2]/50)
- end
- wait()
- end
- p:Destroy()
- plr.Character.Humanoid.WalkSpeed = 16
- plr.Character.Humanoid.JumpPower = 50
- end)
- local aNew = game:GetService("Workspace").ChildAdded:connect(function(c)
- timeStop(c)
- end)
- for i,v in pairs(ignlist) do
- table.remove(ignlist,1)
- end
- plrIgnore(plr.Character)
- timeStop(game:GetService("Workspace"))
- while deb ~= false do wait() end
- --spawn(function()
- local r = 42
- local g = 0
- local b = 255
- local contrast = -2
- for i=1,50 do
- r = r + ((255-42)/50)
- g = g + ((255-0)/50)
- b = b + ((255-255)/50)
- contrast = contrast + 2/50
- --cc.TintColor = Color3.fromRGB(r,g,b)
- cc.Contrast = contrast
- for i,v in pairs(stab) do
- v[1].Pitch = v[1].Pitch + (v[2]/50)
- end
- wait()
- end
- cc:Destroy()
- --end)
- for i,v in pairs(tstab) do
- v.Anchored = false
- end
- for i,v in pairs(tstab) do
- table.remove(tstab,1)
- end
- --table.foreach(stab,print)
- for i,v in pairs(stab) do
- table.remove(stab,1)
- end
- --print("---------")
- --table.foreach(stab,print)
- --[[for i,v in pairs(tsstab) do
- v.Disabled = false
- end
- for i,v in pairs(tsstab) do
- table.remove(tsstab,1)
- end]]
- aNew:disconnect()
- deb = false
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement