Advertisement
basbas1234

TimeStop LS

Oct 5th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.55 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Compatibility Part
  3. local CurrentUser = script:WaitForChild("Owner") local Detector = CurrentUser:WaitForChild("Detector") CurrentUser.Value = game.Players:GetPlayerFromCharacter(script.Parent) if (CurrentUser or Detector) == nil then print("Not Found Default Variables"); return end if game:GetService("RunService"):IsClient() then error("Write rls/ to activate this script.") end; print("FE Compatibility version LoadString: by basbas1234"); InternalData = {} do 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 = Detector Detector.Disabled = false 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 = CurrentUser.Value; print("Complete! Running...")
  4. -------------------------------------------------------------------------------------------------------------------
  5.  
  6. -- PasteScript Here VV -- and upload on pastebin
  7.  
  8. script.Parent = nil;
  9.  
  10. local Player = game.Players.LocalPlayer
  11. local Mouse = Player:GetMouse()
  12. local Character = Player.Character
  13. local Humanoid = Character:FindFirstChildOfClass('Humanoid')
  14. local HumanoidRootPart = Character:FindFirstChild('HumanoidRootPart')
  15. local Torso = Character:FindFirstChild('Torso') or Character:FindFirstChild('LowerTorso')
  16.  
  17. local Players = game:GetService('Players')
  18. local Lighting = game:GetService('Lighting')
  19. local Debris = game:GetService('Debris')
  20. local TweenService = game:GetService('TweenService')
  21. local RunService = game:GetService('RunService')
  22.  
  23. TimeStopped = false
  24. CanTimeStop = true
  25.  
  26. SoundTimeResume = 864569342
  27. SoundTimeStop = 1193182658
  28. SoundRealTime = 3084205248
  29.  
  30. function CreateSound(name, id, par, vol, pit, loop, destroyended)
  31.     local S = Instance.new("Sound")
  32.     S.Name = name
  33.     S.Volume = vol
  34.     S.Pitch = pit or 1
  35.     S.SoundId = "rbxassetid://" ..id
  36.     S.Parent = par or workspace
  37.     S.Looped = loop
  38.     S:Play()
  39.     if (destroyended) then
  40.         S.Ended:Connect(function()
  41.             Debris:AddItem(S, 0)
  42.         end)
  43.     end
  44.     return S
  45. end
  46.  
  47. RemoveOutlines = function(part)
  48.     part.BackSurface,part.BottomSurface,part.FrontSurface,part.LeftSurface,part.RightSurface,part.TopSurface = 10,10,10,10,10,10
  49. end
  50.  
  51. function CreatePart(Parent, Material, Reflectance, Transparency, Anchored, CanCollide, RGBColor3, Name, Size)
  52.     local Part = Instance.new("Part")
  53.         Part.Parent = Parent
  54.         Part.Reflectance = Reflectance
  55.         Part.Transparency = Transparency
  56.         Part.CanCollide = CanCollide
  57.         Part.Anchored = Anchored
  58.         Part.Locked = true
  59.         Part.Color = RGBColor3
  60.         Part.Name = Name
  61.         Part.Size = Size
  62.         Part.Material = Material
  63.         RemoveOutlines(Part)
  64.     return Part
  65. end
  66.  
  67. function CreateWeld(Parent, Part0, Part1, C0, C1)
  68.     local Weld = Instance.new("Weld")
  69.         Weld.Parent = Parent
  70.         Weld.Part0 = Part0
  71.         Weld.Part1 = Part1
  72.         Weld.C0 = C0
  73.         Weld.C1 = C1
  74.     return Weld
  75. end
  76.  
  77. function FindAscendant(Oject, Class)
  78.     local Current = Oject
  79.     local Result = nil
  80.     pcall(function()
  81.         repeat
  82.             Current = Current.Parent
  83.             if Current:IsA(Class) then
  84.                 Result = Current
  85.                 break
  86.             end
  87.         until Current == nil
  88.     end)
  89.     return Result
  90. end
  91.  
  92. function CamShake(Duration, Intensity)
  93.     coroutine.wrap(function()
  94.         for i = 1, Duration do
  95.             Humanoid.CameraOffset = Humanoid.CameraOffset:Lerp(Vector3.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1)), 0.1 * Intensity)
  96.             RunService.RenderStepped:Wait()
  97.         end
  98.         Humanoid.CameraOffset = Vector3.new(0, 0, 0)
  99.     end)()
  100. end
  101.  
  102. RealTime = nil
  103. Theme = nil
  104. ColorCorrectionEffect = Instance.new('ColorCorrectionEffect', Lighting)
  105. ColorCorrectionEffect.Name = 'Theme'
  106. ColorCorrectionEffect.Brightness = 0
  107. ColorCorrectionEffect.Saturation = 0
  108. ColorCorrectionEffect.TintColor = Color3.fromRGB(255, 255, 255)
  109.  
  110. Stopped = {}
  111. MyWorkspace = nil
  112. MyLighting = nil
  113. FakeHumanoidRootPart = nil
  114.  
  115. function CompletelyTimeStop()
  116.     -- Freeze Lighting;
  117.     local CurrentTime = Lighting.TimeOfDay
  118.     local CurrentBrightness = Lighting.Brightness
  119.     local CurrentAmbient = Lighting.Ambient
  120.     local CurrentOutdoorAmbient = Lighting.OutdoorAmbient
  121.     local CurrentFogEnd = Lighting.FogEnd
  122.     local CurrentFogStart = Lighting.FogStart
  123.     local CurrentFogColor = Lighting.FogColor
  124.     MyLighting = Lighting.Changed:Connect(function()
  125.         Lighting.TimeOfDay = CurrentTime
  126.         Lighting.Brightness = CurrentBrightness
  127.         Lighting.Ambient = CurrentAmbient
  128.         Lighting.OutdoorAmbient = CurrentOutdoorAmbient
  129.         Lighting.FogEnd = CurrentFogEnd
  130.         Lighting.FogStart = CurrentFogStart
  131.         Lighting.FogColor = CurrentFogColor
  132.     end)
  133.     -- // Passive
  134.     if (MyWorkspace ~= nil) then
  135.         MyWorkspace:Disconnect();
  136.         MyWorkspace = nil
  137.     end
  138.     MyWorkspace = workspace.DescendantAdded:Connect(function(Self)
  139.         if (Self:IsA('Sound') and not Character:IsAncestorOf(Self)) then
  140.             Stopped[Self] = Self.Parent
  141.             Self:Pause()
  142.         end
  143.         if ((Self:IsA('BasePart') or Self:IsA('UnionOperation')) and not Character:IsAncestorOf(Self) and not (FindAscendant(Self, 'Tool') or FindAscendant(Self, 'HopperBin'))) then
  144.             if not (Self.Anchored) then
  145.                 Stopped[Self] = Self
  146.                 Self.Anchored = true
  147.             end
  148.         end
  149.     end)
  150.     -- // Active
  151.     for Index, AtPlayer in pairs(Players:GetPlayers()) do
  152.         local AtCharacter = AtPlayer.Character
  153.         if (AtCharacter) then
  154.             for _Index, Self in pairs(AtCharacter:GetDescendants()) do
  155.                 if (Self:IsA('Sound') and not Character:IsAncestorOf(Self)) then
  156.                     if (Self.Playing) then
  157.                         Stopped[Self] = Self.Parent
  158.                         spawn(function()
  159.                             for Count = 1, 5 do
  160.                                 Self.Playing = not Self.Playing
  161.                                 wait(1 / 5)
  162.                             end
  163.                             Self:Pause()
  164.                         end)
  165.                     end
  166.                 end
  167.                 if ((Self:IsA('BasePart') or Self:IsA('UnionOperation')) and not Character:IsAncestorOf(Self) and not (FindAscendant(Self, 'Tool') or FindAscendant(Self, 'HopperBin'))) then
  168.                     if not (Self.Anchored) then
  169.                         Stopped[Self] = Self
  170.                         spawn(function()
  171.                             for Count = 1, 5 do
  172.                                 Self.Anchored = not Self.Anchored
  173.                                 wait(1 / 5)
  174.                             end
  175.                             Self.Anchored = true
  176.                         end)
  177.                     end
  178.                 end
  179.             end
  180.         end
  181.     end--[[
  182.     for Index, Self in pairs(workspace:GetChildren()) do
  183.         if (Self:IsA('Sound') and not Character:IsAncestorOf(Self)) then
  184.             if (Self.Playing) then
  185.                 Stopped[Self] = Self.Parent
  186.                 spawn(function()
  187.                     for Count = 1, 5 do
  188.                         Self.Playing = not Self.Playing
  189.                         wait(1 / 5)
  190.                     end
  191.                     Self:Pause()
  192.                 end)
  193.             end
  194.         end
  195.         if (Self:IsA('Model') or Self:IsA('Folder')) then
  196.             spawn(function()
  197.                 for Index, Child in pairs(Self:GetDescendants()) do
  198.                     if ((Child:IsA('BasePart') or Child:IsA('UnionOperation')) and not Character:IsAncestorOf(Child) and not (FindAscendant(Child, 'Tool') or FindAscendant(Child, 'HopperBin'))) then
  199.                         if not (Child.Anchored) then
  200.                             Stopped[Child] = Child
  201.                             spawn(function()
  202.                                 for Count = 1, 5 do
  203.                                     Child.Anchored = not Child.Anchored
  204.                                     wait(1 / 5)
  205.                                 end
  206.                                 Child.Anchored = true
  207.                             end)
  208.                         end
  209.                     end
  210.                 end
  211.             end)
  212.         end
  213.         if ((Self:IsA('BasePart') or Self:IsA('UnionOperation')) and not Character:IsAncestorOf(Self) and not (FindAscendant(Self, 'Tool') or FindAscendant(Self, 'HopperBin'))) then
  214.             if not (Self.Anchored) then
  215.                 Stopped[Self] = Self
  216.                 spawn(function()
  217.                     for Count = 1, 5 do
  218.                         Self.Anchored = not Self.Anchored
  219.                         wait(1 / 5)
  220.                     end
  221.                     Self.Anchored = true
  222.                 end)
  223.             end
  224.         end
  225.     end--]]
  226. end
  227.  
  228. function CompletelyTimeResume()
  229.     -- // Passive
  230.     if (MyWorkspace ~= nil) then
  231.         MyWorkspace:Disconnect();
  232.         MyWorkspace = nil
  233.     end
  234.     if (MyLighting ~= nil) then
  235.         MyLighting:Disconnect();
  236.         MyLighting = nil
  237.     end
  238.     -- // Active
  239.     for i,v in pairs(Stopped) do
  240.         pcall(function()
  241.             v.Anchored = false
  242.             Stopped[i] = nil
  243.         end)
  244.         pcall(function()
  245.             v:Resume()
  246.             Stopped[i] = nil
  247.         end)
  248.     end
  249. end
  250.  
  251. function TimeStop()
  252.     CanTimeStop = false
  253.     CreateSound('TimeStop', SoundTimeStop, Character, 4, 1, false, true)
  254.     -- Freeze-Local | Method by basbas1234
  255.     if (Humanoid.RigType == Enum.HumanoidRigType.R6) then
  256.         Torso.Anchored = true
  257.         FakeHumanoidRootPart = HumanoidRootPart:Clone()
  258.         HumanoidRootPart.Name = 'Fake'
  259.         FakeHumanoidRootPart.Parent = Character
  260.         FakeHumanoidRootPart.Name = 'HumanoidRootPart'
  261.         Torso.Anchored = false
  262.     else
  263.         Torso.Anchored = true
  264.         HumanoidRootPart.Anchored = true
  265.         local Root = Torso:WaitForChild('Root')
  266.         FakeHumanoidRootPart = HumanoidRootPart:Clone()
  267.         FakeHumanoidRootPart.Parent = Character
  268.         HumanoidRootPart.Name = 'Fake'
  269.         local Motor6D = Instance.new('Motor6D', HumanoidRootPart)
  270.         Motor6D.Name = 'Fake'
  271.         Motor6D.Part0 = HumanoidRootPart
  272.         Motor6D.Part1 = FakeHumanoidRootPart
  273.         Root.Part0 = FakeHumanoidRootPart
  274.         FakeHumanoidRootPart.Anchored = false
  275.         HumanoidRootPart.Anchored = false
  276.         Torso.Anchored = false
  277.     end
  278.     -- Ball;
  279.     local TimeStopEffect = CreatePart(workspace, Enum.Material.ForceField, 0, 1, true, false, Color3.fromRGB(255, 255, 255), 'Effect', Vector3.new(0.05, 0.05, 0.05))
  280.     TimeStopEffect.CastShadow = false
  281.     TimeStopEffect.Shape = Enum.PartType.Ball
  282.     TimeStopEffect.CFrame = Torso.CFrame
  283.     local TimeStopEffectAnimateIn = TweenService:Create(
  284.         TimeStopEffect,
  285.         TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false),
  286.         {
  287.             Transparency = 0;
  288.             Size = Vector3.new(200, 200, 200)
  289.         }
  290.     )
  291.     local TimeStopEffectAnimateOut = TweenService:Create(
  292.         TimeStopEffect,
  293.         TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0, false),
  294.         {
  295.             Color = Color3.fromRGB(0, 0, 0);
  296.             Size = Vector3.new(0.05, 0.05, 0.05)
  297.         }
  298.     )
  299.     spawn(function()
  300.         Debris:AddItem(TimeStopEffect, 6 + 1)
  301.         TimeStopEffectAnimateIn:Play(); wait(0.05)
  302.         wait(2 - 0.05)
  303.         CamShake(60, 5)
  304.         CamShake(120, 2.5)
  305.         CamShake(180, 1)
  306.         TimeStopEffectAnimateOut:Play()
  307.     end)
  308.     wait(3)
  309.     -- Lighting;
  310.     ColorCorrectionEffect = Lighting:FindFirstChildOfClass('ColorCorrectionEffect') or Instance.new('ColorCorrectionEffect', Lighting)
  311.     ColorCorrectionEffect.Name = 'Theme'
  312.     Theme = TweenService:Create(
  313.         ColorCorrectionEffect,
  314.         TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false),
  315.         {
  316.             Brightness = -0.05;
  317.             Saturation = -1;
  318.         }
  319.     )
  320.     Theme:Play()
  321.     -- Completely-TimeStop
  322.     CompletelyTimeStop()
  323.     wait(2)
  324.     if not (RealTime ~= nil) then
  325.         RealTime = CreateSound('RealTime', SoundRealTime, Character, 4, 1, true, false)
  326.     end
  327.     wait(2)
  328.     TimeStopped = true
  329. end
  330.  
  331. function TimeResume()
  332.     TimeStopped = false
  333.     if (RealTime ~= nil) then
  334.         RealTime:Stop()
  335.         RealTime.Parent = nil
  336.         RealTime = nil
  337.     end
  338.     if (Theme ~= nil) then
  339.         Theme:Cancel()
  340.         Theme = TweenService:Create(
  341.             ColorCorrectionEffect,
  342.             TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false),
  343.             {
  344.                 Brightness = 0;
  345.                 Saturation = 0;
  346.             }
  347.         )
  348.         Theme:Play()
  349.         Theme = nil
  350.     end
  351.     CompletelyTimeResume()
  352.     CreateSound('TimeResume', SoundTimeResume, Character, 1, 1, false, true)
  353.     -- Unfreeze-Local | Method by basbas1234
  354.     if (Humanoid.RigType == Enum.HumanoidRigType.R6) then
  355.         Torso.Anchored = true
  356.         HumanoidRootPart.Name = 'HumanoidRootPart'
  357.         FakeHumanoidRootPart.Parent = nil
  358.         Torso.Anchored = false
  359.     else
  360.         Torso.Anchored = true
  361.         HumanoidRootPart.Anchored = true
  362.         FakeHumanoidRootPart.Parent = nil
  363.         HumanoidRootPart.Name = 'HumanoidRootPart'
  364.         local Motor6D = HumanoidRootPart:FindFirstChildOfClass('Motor6D')
  365.         if (Motor6D) then
  366.             Motor6D.Parent = nil
  367.         end
  368.         local Root = Torso:WaitForChild('Root')
  369.         Root.Part0 = HumanoidRootPart
  370.         Torso.Anchored = false
  371.         HumanoidRootPart.Anchored = false
  372.     end
  373.     wait(5)
  374.     CanTimeStop = true
  375. end
  376.  
  377. Mouse.KeyDown:Connect(function(Key)
  378.     if (Key:lower() == 'y' and not TimeStopped and CanTimeStop) then
  379.         TimeStop()
  380.     elseif (Key:lower() == 'y' and TimeStopped) then
  381.         TimeResume()
  382.     end
  383. end)
  384.  
  385. Player.CharacterAdded:Connect(function(NewCharacter)
  386.     Character = NewCharacter
  387.     Humanoid = Character:FindFirstChildOfClass('Humanoid') or Character:WaitForChild('Humanoid')
  388.     HumanoidRootPart = Character:FindFirstChild('HumanoidRootPart')
  389.     Torso = Character:FindFirstChild('Torso') or Character:FindFirstChild('LowerTorso')
  390. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement