local freeze = true local parent local human = script.Parent.Humanoid local kids = {} local frozen = {} local stopedscript = {} local younfreezeme = {} local fzn = 1 local fzn2 = 1 local unfrze = 1 local light = script.Parent.Handle.PointLight wait() function FlashBang()
local players = game.Players:GetPlayers()
--print("number blinded: " .. #players)
local effects = {}
local tosserEffect = nil
for i = 1,#players do
local guiMain = Instance.new("GuiMain")
guiMain.Parent = players[i].PlayerGui
local mainFrame = Instance.new("Frame")
mainFrame.Name = "FlashBangEffect"
mainFrame.Position = UDim2.new(-.2, 0, -.2, 0)
mainFrame.Size = UDim2.new(1.5, 0, 1.5, 0)
mainFrame.BackgroundColor = BrickColor.new(193, 223, 240)
mainFrame.BorderColor = BrickColor.new(193, 223, 240)
mainFrame.Parent = guiMain
if (players[i] ~= script.Parent) then
effects[#effects + 1] = mainFrame
else
tosserEffect = mainFrame
end
end
wait(.1)
for t = 1, 9 do
for n = 1, #effects do
effects[n].Transparency = t / 10
end
wait(.05)
end
for n = 1, #effects do
effects[n]:Remove()
end
end
script.Parent.Equipped:Connect(function(urmom)
parent = script.Parent.Parent
kids = script.Parent.Parent:GetDescendants()
script.Parent.Humanoid.Script.Disabled = false
for i=1,#kids do
if kids[i]:IsA("Script") or kids[i]:IsA("LocalScript") then
if kids[i].Disabled == false then
younfreezeme[unfrze] = kids[i]
--print(younfreezeme[unfrze].Name)
unfrze = unfrze + 1
end
end
end
end)
function unfreezeplr(thing)
for i=1,#thing do
if thing[i]:IsA("BasePart") then
thing[i].Anchored = false
end
end
local ii=1
while ii<unfrze do
younfreezeme[ii].Disabled = false
--print(younfreezeme[ii].Name.." was unfrozen")
ii=ii+1
end
end
function stoptime(thing)
for i, v in pairs(thing) do
if thing[i]:IsA("BasePart") then
if thing[i].Anchored == false then
if (thing[i] ~= kids[i]) then
thing[i].Anchored = true
--print(thing[i].Name.." was anchored")
frozen[fzn] = thing[i]
fzn = fzn+1
end
end
end
if thing[i]:IsA("Humanoid") then
if thing[i].Parent ~= parent then
print("Found one")
local iced = script.Freeze:Clone()
iced.Parent = thing[i].Parent
iced.Disabled = false
end
end
if thing[i]:IsA("Script") or thing[i]:IsA("LocalScript") and thing.Name ~= "Freeze" then
if thing[i].Disabled == false then
if thing[i] ~= script then
if (thing[i] ~= younfreezeme[i]) then
thing[i].Disabled = true
--print(thing[i].Name.." was Disabled")
stopedscript[fzn2] = thing[i]
fzn2=fzn2+1
end
end
end
end
end
end
function unfreezeall()
for i=1,#frozen do
frozen[i].Anchored = false
end
for i=1,#stopedscript do
stopedscript[i].Disabled = false
end
fzn = 1
fzn2 = 1
frozen = {}
stopedscript = {}
print("successfully unfroze everyone!")
end
script.Parent.Activated:Connect(function()
print(freeze)
if freeze == true then
freeze = false
script.Parent.Handle.Sound:Play()
wait(2)
local gw = game.Workspace:GetDescendants()
print("freezing everyone now")
script.Parent.Message.Text = ""
stoptime(gw)
unfreezeplr(kids)
local newsc = script.TimeStop:Clone()
newsc.Parent = script.Parent
game.Lighting.ColorChanger2.Enabled = true
game.Lighting.ColorChanger3.Enabled = true
newsc.Disabled = false
script.Parent.cooleffects.Disabled = false
FlashBang()
game.Lighting.ColorChanger2.Enabled = false
game.Lighting.ColorChanger3.Enabled = false
game.Lighting.ColorChanger.Enabled = true
wait(13)
script.Parent.Handle.TimeResume:Play()
local texty = Instance.new("Message",game.Workspace)
wait(2)
texty:Remove()
unfreezeall()
script.Parent.cooleffects.Disabled = true
freeze = true
end
game.Lighting.ColorChanger.Enabled = false
wait(5) end) human.HealthChanged:Connect(function() if human.Health == 10 then unfreezeall() script.Parent.Handle.TimeResume:Play() wait(2.1) unfreezeall() end end)
so far nothing worked.

1 comment
So, your code is just not well formatted and it would be better to show a sample of code that errors or that is the main area. From what I see in your title you would need a debounce. Here is a useful link: https://developer.roblox.com/en-us/articles/Debounce