Advertisement
Guest User

DIO's Time Stop Script

a guest
May 27th, 2022
8,428
1
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.54 KB | None | 1 0
  1. -- [DIO's Time Stop Script] --
  2.  
  3. -- Based on the main ability of DIO's Stand, The World, from Part 3 of JoJo's Bizarre Adventure.
  4.  
  5. -- MOST of everything in this script is written by Tsuagon, except for the screenshake part, that was taken from a tutorial. Credit to the people to made said tutorials and scripts.
  6.  
  7. ----------------------------------------------------------------------------------------------------
  8.  
  9. -- Player Stuff --
  10.  
  11. local player = game:GetService("Players").LocalPlayer
  12. local char = player.Character
  13. local head = char.Head
  14. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  15. local root = char.HumanoidRootPart
  16. local humanoid = char.Humanoid
  17.  
  18. local playerhealth = humanoid.Health
  19.  
  20. local mouse = player:GetMouse()
  21.  
  22. ----------------------------------------------------------------------------------------------------
  23.  
  24. -- General Stuff --
  25.  
  26. local tween = game:GetService("TweenService")
  27. local lighting = game:GetService("Lighting")
  28. local input = game:GetService("UserInputService")
  29.  
  30. local frozenobjectstable = {}
  31.  
  32. seconds = 5 -- You can change the length in which time is stopped for by modifying this number.
  33.  
  34. stoppedtime = false
  35.  
  36. -- Time Stop Effect
  37.  
  38. local timestopeffect = Instance.new("ColorCorrectionEffect")
  39. timestopeffect.Parent = lighting
  40. timestopeffect.Saturation = 0
  41. timestopeffect.Contrast = 0
  42. timestopeffect.Enabled = true
  43.  
  44. -- Sphere Effect
  45.  
  46. local timestopsphere1 = Instance.new("Part")
  47. timestopsphere1.Parent = torso
  48. timestopsphere1.Material = Enum.Material.ForceField
  49. timestopsphere1.Size = Vector3.new(0, 0, 0)
  50. timestopsphere1.Shape = Enum.PartType.Ball
  51. timestopsphere1.CanCollide = false
  52. timestopsphere1.Massless = true
  53. timestopsphere1.Color = Color3.new(1, 1, 1)
  54. timestopsphere1.CastShadow = false
  55.  
  56. local sphere1weld = Instance.new("Weld")
  57. sphere1weld.Part0 = timestopsphere1
  58. sphere1weld.Part1 = torso
  59. sphere1weld.C0 = torso.CFrame
  60. sphere1weld.C1 = torso.CFrame
  61. sphere1weld.Parent = timestopsphere1
  62.  
  63. local timestopsphere2 = Instance.new("Part")
  64. timestopsphere2.Parent = torso
  65. timestopsphere2.Material = Enum.Material.ForceField
  66. timestopsphere2.Size = Vector3.new(0, 0, 0)
  67. timestopsphere2.Shape = Enum.PartType.Ball
  68. timestopsphere2.CanCollide = false
  69. timestopsphere2.Massless = true
  70. timestopsphere2.Color = Color3.new(1, 1, 1)
  71. timestopsphere2.CastShadow = false
  72.  
  73. local sphere2weld = Instance.new("Weld")
  74. sphere2weld.Part0 = timestopsphere2
  75. sphere2weld.Part1 = torso
  76. sphere2weld.C0 = torso.CFrame
  77. sphere2weld.C1 = torso.CFrame
  78. sphere2weld.Parent = timestopsphere2
  79.  
  80. local timestopsphere3 = Instance.new("Part")
  81. timestopsphere3.Parent = torso
  82. timestopsphere3.Material = Enum.Material.ForceField
  83. timestopsphere3.Size = Vector3.new(0, 0, 0)
  84. timestopsphere3.Shape = Enum.PartType.Ball
  85. timestopsphere3.CanCollide = false
  86. timestopsphere3.Massless = true
  87. timestopsphere3.Color = Color3.new(1, 1, 1)
  88. timestopsphere3.CastShadow = false
  89.  
  90. local sphere3weld = Instance.new("Weld")
  91. sphere3weld.Part0 = timestopsphere3
  92. sphere3weld.Part1 = torso
  93. sphere3weld.C0 = torso.CFrame
  94. sphere3weld.C1 = torso.CFrame
  95. sphere3weld.Parent = timestopsphere3
  96.  
  97. -- Sounds
  98.  
  99. local timestopvoiceline = Instance.new("Sound", head)
  100. timestopvoiceline.SoundId = "rbxassetid://7514417921"
  101. timestopvoiceline.Volume = 5
  102.  
  103. local injuredtimestopvoiceline = Instance.new("Sound", head)
  104. injuredtimestopvoiceline.SoundId = "rbxassetid://6043864223"
  105. injuredtimestopvoiceline.Volume = 5
  106.  
  107. local tssfx = Instance.new("Sound", head)
  108. tssfx.SoundId = "rbxassetid://5679636294"
  109. tssfx.Volume = 5
  110.  
  111. local timeresumevoiceline = Instance.new("Sound", head)
  112. timeresumevoiceline.SoundId = "rbxassetid://4329802996"
  113. timeresumevoiceline.Volume = 5
  114.  
  115. local injuredtimeresumevoiceline = Instance.new("Sound", head)
  116. injuredtimeresumevoiceline.SoundId = "rbxassetid://6043853981"
  117. injuredtimeresumevoiceline.Volume = 5
  118.  
  119. local countervoiceline = Instance.new("Sound", head)
  120. countervoiceline.SoundId = "rbxassetid://6675048510"
  121. countervoiceline.Volume = 5
  122.  
  123. local countersfx = Instance.new("Sound", head)
  124. countersfx.SoundId = "rbxassetid://4572672240"
  125. countersfx.Volume = 4.5
  126.  
  127. local tsteleportsfx = Instance.new("Sound", torso)
  128. tsteleportsfx.SoundId = "rbxassetid://3077287610"
  129. tsteleportsfx.Volume = 4.5
  130.  
  131. local clock = Instance.new("Sound", workspace)
  132. clock.SoundId = "rbxassetid://4940109913"
  133. clock.Volume = 4.5
  134. clock.Looped = true
  135.  
  136. ----------------------------------------------------------------------------------------------------
  137.  
  138. -- Main Script --
  139.  
  140. function timestop()
  141.     if stoppedtime == true then return end
  142.     if humanoid.Health < 50 then
  143.         injuredtimestopvoiceline:Play()
  144.         wait(1)
  145.         tssfx:Play()
  146.     elseif humanoid.Health > 50 then
  147.         timestopvoiceline:Play()
  148.         wait(1.6)
  149.     end
  150.         settings().Network.IncomingReplicationLag = math.huge
  151.     for _, v in pairs(workspace:GetDescendants()) do
  152.         if v:IsA("BasePart") then
  153.             if not v.Anchored == true then
  154.                 if not v:IsDescendantOf(char) then
  155.                     v.Anchored = true
  156.                     table.insert(frozenobjectstable, v)
  157.                 end
  158.             end
  159.         end
  160.     end
  161.     coroutine.resume(coroutine.create(function()
  162.         coroutine.resume(coroutine.create(function()
  163.             timestopeffect.Enabled = true
  164.             tween:Create(workspace.CurrentCamera, TweenInfo.new(1.5, Enum.EasingStyle.Exponential), {FieldOfView = 250}):Play();
  165.             coroutine.resume(coroutine.create(function()
  166.                 while stoppedtime == false do
  167.                     tween:Create(timestopeffect, TweenInfo.new(0.8, Enum.EasingStyle.Quart), {Contrast = -2}):Play();
  168.                     wait(0.3)
  169.                     tween:Create(timestopeffect, TweenInfo.new(0.5, Enum.EasingStyle.Quart), {Saturation = -1}):Play();
  170.                     wait(0.2)
  171.                     tween:Create(timestopeffect, TweenInfo.new(0.5, Enum.EasingStyle.Quart), {Saturation = -2}):Play();
  172.                     wait()
  173.                     tween:Create(timestopeffect, TweenInfo.new(0.8, Enum.EasingStyle.Quart), {Contrast = -2.4}):Play();
  174.                     wait(0.3)
  175.                     tween:Create(timestopeffect, TweenInfo.new(0.5, Enum.EasingStyle.Quart), {Saturation = 1}):Play();
  176.                     wait(0.2)
  177.                     tween:Create(timestopeffect, TweenInfo.new(0.5, Enum.EasingStyle.Quart), {Saturation = -2}):Play();
  178.                 end
  179.             end))
  180.             wait(1.7)
  181.             tween:Create(workspace.CurrentCamera, TweenInfo.new(1, Enum.EasingStyle.Quart), {FieldOfView = 70}):Play();
  182.             tween:Create(timestopeffect, TweenInfo.new(1, Enum.EasingStyle.Quart), {Contrast = 0}):Play();
  183.             tween:Create(timestopeffect, TweenInfo.new(1, Enum.EasingStyle.Quart), {Saturation = -0.8}):Play();
  184.         end))
  185.         coroutine.resume(coroutine.create(function()
  186.             for _ = 1, 65 do
  187.                 wait()
  188.                 local offset1 = math.random(-650, 650) / 700
  189.                 local offset2 = math.random(-650, 650) / 700
  190.                 local offset3 = math.random(-650, 650) / 700
  191.                 tween:Create(humanoid, TweenInfo.new(0.1), {CameraOffset = Vector3.new(offset1, offset2, offset3)}):Play();
  192.             end
  193.             tween:Create(humanoid, TweenInfo.new(0.1), {CameraOffset = Vector3.new(0, 0, 0)}):Play();
  194.         end))
  195.         coroutine.resume(coroutine.create(function()
  196.             tween:Create(timestopsphere1, TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0), {Size = Vector3.new(45, 45, 45)}):Play();
  197.             tween:Create(timestopsphere2, TweenInfo.new(1.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0), {Size = Vector3.new(40, 40, 40)}):Play();
  198.             tween:Create(timestopsphere3, TweenInfo.new(1.7, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0), {Size = Vector3.new(35, 35, 35)}):Play();
  199.             wait(1.7)
  200.             tween:Create(timestopsphere1, TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0), {Size = Vector3.new(0, 0, 0)}):Play();
  201.             tween:Create(timestopsphere2, TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0), {Size = Vector3.new(0, 0, 0)}):Play();
  202.             tween:Create(timestopsphere3, TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0), {Size = Vector3.new(0, 0, 0)}):Play();
  203.         end))
  204.         coroutine.resume(coroutine.create(function()
  205.             for _, v in pairs(workspace:GetDescendants()) do
  206.                 if v:IsA("ParticleEmitter") then
  207.                     tween:Create(v, TweenInfo.new(3), {TimeScale = 0}):Play();
  208.                 end
  209.             end
  210.             for _, v in pairs(workspace:GetDescendants()) do
  211.                 if v:IsA("Fire") then
  212.                     tween:Create(v, TweenInfo.new(3), {TimeScale = 0}):Play();
  213.                 end
  214.             end
  215.         end))
  216.         coroutine.resume(coroutine.create(function()
  217.             for _, v in pairs(workspace:GetDescendants()) do
  218.                 if v:IsA("Sound") then
  219.                     if not v:IsDescendantOf(char) then
  220.                         tween:Create(v, TweenInfo.new(4), {PlaybackSpeed = 0}):Play();
  221.                     end
  222.                 end
  223.             end
  224.         end))
  225.     end))
  226.     stoppedtime = true
  227.     wait(seconds)
  228.     timeresume()
  229. end
  230.  
  231. function timeresume()
  232.     if stoppedtime == false then return end
  233.     if humanoid.Health < 50 then
  234.         injuredtimeresumevoiceline:Play()
  235.         wait(0.6)
  236.     elseif humanoid.Health > 50 then
  237.         timeresumevoiceline:Play()
  238.         wait(0.9)
  239.     end
  240.         settings().Network.IncomingReplicationLag = 0
  241.     for _, v in pairs(frozenobjectstable) do
  242.         if v:IsA("BasePart") then
  243.             v.Anchored = false
  244.         end
  245.     end
  246.     coroutine.resume(coroutine.create(function()
  247.         for _, v in pairs(workspace:GetDescendants()) do
  248.             if v:IsA("ParticleEmitter") then
  249.                 tween:Create(v, TweenInfo.new(3), {TimeScale = 1}):Play();
  250.             end
  251.         end
  252.         for _, v in pairs(workspace:GetDescendants()) do
  253.             if v:IsA("Fire") then
  254.                 tween:Create(v, TweenInfo.new(3), {TimeScale = 1}):Play();
  255.             end
  256.         end
  257.     end))
  258.     coroutine.resume(coroutine.create(function()
  259.         for _, v in pairs(workspace:GetDescendants()) do
  260.             if v:IsA("Sound") then
  261.                 if not v:IsDescendantOf(char) then
  262.                     tween:Create(v, TweenInfo.new(2), {PlaybackSpeed = 1}):Play();
  263.                 end
  264.             end
  265.         end
  266.     end))
  267.     tween:Create(timestopeffect, TweenInfo.new(2, Enum.EasingStyle.Quart), {Saturation = 0}):Play();
  268.     stoppedtime = false
  269. end
  270.  
  271. function tsteleport()
  272.     if stoppedtime == true then return end
  273.     tsteleportsfx:Play()
  274.     coroutine.resume(coroutine.create(function()
  275.         tween:Create(timestopeffect, TweenInfo.new(0.1), {TintColor = Color3.new(0, 0, 0)}):Play();
  276.         wait(0.2)
  277.         tween:Create(timestopeffect, TweenInfo.new(0.1), {TintColor = Color3.new(1, 1, 1)}):Play();
  278.     end))
  279.     root.CFrame = CFrame.new(mouse.Hit.p.X, mouse.Hit.p.Y, mouse.Hit.p.Z)
  280. end
  281.  
  282. --[[function counter()
  283.     countervoiceline:Play()
  284.     wait(0.6)
  285.     humanoid.HealthChanged:Connect(function(health)
  286.         if playerhealth > 100 then
  287.             countersfx:Play()
  288.             root.CFrame = root.CFrame + root.CFrame.lookVector * -20
  289.         elseif health == playerhealth then return end
  290.     end)
  291. end]]--
  292.  
  293. mouse.KeyDown:Connect(function(key)
  294.     if key == "f" and stoppedtime == false then
  295.         timestop()
  296.     elseif key == "f" and stoppedtime == true then
  297.         timeresume()
  298.     end
  299.     if key == "v" and stoppedtime == false then
  300.         tsteleport()
  301.     end
  302. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement