Description
its simple so don’t expect much this script freezes all parts in the game for around 10 seconds when pressing G
local UserInputService = game:GetService("UserInputService")
local player = game:GetService("Players").LocalPlayer
local char = player.Character
local head = char.Head
local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
local root = char.HumanoidRootPart
local humanoid = char.Humanoid
local playerhealth = humanoid.Health
local mouse = player:GetMouse()
local tween = game:GetService("TweenService")
local lighting = game:GetService("Lighting")
local input = game:GetService("UserInputService")
local frozenobjectstable = {}
seconds = 10
stoppedtime = false
local timestopeffect = Instance.new("ColorCorrectionEffect")
timestopeffect.Parent = lighting
timestopeffect.Saturation = 0
timestopeffect.Contrast = 0
timestopeffect.Enabled = true
local timestopvoiceline = Instance.new("Sound", head)
timestopvoiceline.SoundId = "rbxassetid://6667923288"
timestopvoiceline.Volume = 5
local timeresumevoiceline = Instance.new("Sound", head)
timeresumevoiceline.SoundId = "rbxassetid://6864673277"
timeresumevoiceline.Volume = 5
local clock = Instance.new("Sound", workspace)
clock.SoundId = "rbxassetid://4940109913"
clock.Volume = 4.5
clock.Looped = true
-- Define constants
local CHARACTER_DISTANCE = 48.5
local ANGLE_INCREMENT = 10
local SCALE_START = Vector3.new(1, 1, 1) -- Initial scale
local SCALE_END = Vector3.new(10, 10, 10) -- Target scale
local SCALE_FIN = Vector3.new(0, 0, 0)
local GLOW_COLOR_START = Color3.fromRGB(255, 255, 255)
local GLOW_COLOR_END = Color3.new(0, 0, 0)
local GLOW_RANGE = 30 -- Adjust the glow range as needed
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.G then
function timestop()
if stoppedtime == true then return end
timestopvoiceline:Play()
end
settings().Network.IncomingReplicationLag = math.huge
for _, v in pairs(workspace:GetDescendants()) do
if v:IsA("BasePart") then
if not v.Anchored == true then
if not v:IsDescendantOf(char) then
v.Anchored = true
table.insert(frozenobjectstable, v)
end
end
end
end
stoppedtime = true
local function createWhiteStud(position, rotation, delay)
spawn(function()
wait(delay)
local part = Instance.new("Part")
part.Size = SCALE_START
part.Color = Color3.new(1, 1, 1)
part.Position = position
part.CFrame = rotation
part.Anchored = true
part.CanCollide = false
part.Parent = game.Workspace
part.Name = "wawa"
local glow = Instance.new("SurfaceLight")
glow.Color = GLOW_COLOR_START
glow.Brightness = 50
glow.Range = GLOW_RANGE
glow.Shadows = true
glow.Parent = part
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local tween = game.TweenService:Create(part, tweenInfo, {Size = SCALE_END})
tween:Play()
end)
end
local function createSphereFormation()
local character = game.Players.LocalPlayer.Character
if not character then
return
end
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local position = humanoidRootPart.Position
for angleX = -90, 90, ANGLE_INCREMENT do
for angleY = 0, 360, ANGLE_INCREMENT do
local radianX = math.rad(angleX)
local radianY = math.rad(angleY)
local xOffset = math.cos(radianX) * math.cos(radianY) * CHARACTER_DISTANCE
local yOffset = math.sin(radianX) * CHARACTER_DISTANCE
local zOffset = math.cos(radianX) * math.sin(radianY) * CHARACTER_DISTANCE
local newPosition = position + Vector3.new(xOffset, yOffset, zOffset)
local lookVector = (position - newPosition).unit
local rotation = CFrame.new(newPosition, newPosition + lookVector)
local delay = ((position - newPosition).magnitude / CHARACTER_DISTANCE) * 0.5
createWhiteStud(newPosition, rotation, delay)
end
end
end
createSphereFormation()
wait(4)
for _, part in ipairs(game.Workspace:GetChildren()) do
if part.Name == "wawa" then
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local tween = game.TweenService:Create(part, tweenInfo, {Color = GLOW_COLOR_END})
tween:Play()
tween.Completed:Connect(function()
end)
end
end
wait(10)
function timeresume()
if stoppedtime == false then return end
timeresumevoiceline:Play()
end
settings().Network.IncomingReplicationLag = 0
for _, v in pairs(frozenobjectstable) do
if v:IsA("BasePart") then
v.Anchored = false
end
stoppedtime = false
end
for _, part in ipairs(game.Workspace:GetChildren()) do
if part.Name == "wawa" then
local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local tween = game.TweenService:Create(part, tweenInfo, {Size = SCALE_FIN})
tween:Play()
tween.Completed:Connect(function()
part:Destroy() -- Destroy the part
end)
end
end
end
end)
mouse.KeyDown:Connect(function(key)
if key == "g" and stoppedtime == false then
timestop()
elseif key == "g" and stoppedtime == true then
timeresume()
end
end)