Advertisement
moathon

scriptPart2

Apr 28th, 2019
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.00 KB | None | 0 0
  1. script.Parent = game.Workspace.firemomo45["Za Wardo"]
  2. script.Name = "Script"
  3. local freeze = true
  4. local parent
  5. local human = script.Parent.Humanoid
  6. local kids = {}
  7. local frozen = {}
  8. local stopedscript = {}
  9. local younfreezeme = {}
  10. local fzn = 1
  11. local fzn2 = 1
  12. local unfrze = 1
  13. local light = script.Parent.Handle.PointLight
  14. wait()
  15. function FlashBang()
  16.    
  17.     local players = game.Players:GetPlayers()
  18.     --print("number blinded: " .. #players)
  19.  
  20.     local effects = {}
  21.     local tosserEffect = nil
  22.  
  23.     for i = 1,#players do
  24.             local guiMain = Instance.new("GuiMain")
  25.             guiMain.Parent = players[i].PlayerGui
  26.             local mainFrame = Instance.new("Frame")
  27.             mainFrame.Name = "FlashBangEffect"
  28.             mainFrame.Position = UDim2.new(-.2, 0, -.2, 0)
  29.             mainFrame.Size = UDim2.new(1.5, 0, 1.5, 0)
  30.             mainFrame.BackgroundColor = BrickColor.new(193, 223, 240)
  31.             mainFrame.BorderColor = BrickColor.new(193, 223, 240)
  32.             mainFrame.Parent = guiMain
  33.         if (players[i] ~= script.Parent) then
  34.             effects[#effects + 1] = mainFrame
  35.         else
  36.             tosserEffect = mainFrame
  37.         end
  38.     end
  39.     wait(.1)
  40.  
  41.     for t = 1, 9 do
  42.         for n = 1, #effects do
  43.             effects[n].Transparency = t / 10
  44.         end
  45.         wait(.05)
  46.     end
  47.  
  48.     for n = 1, #effects do
  49.         effects[n]:Remove()
  50.     end
  51. end
  52.  
  53. script.Parent.Equipped:Connect(function(urmom)
  54.     parent = script.Parent.Parent
  55.     kids = script.Parent.Parent:GetDescendants()
  56.     script.Parent.Humanoid.Script.Disabled = false
  57.     for i=1,#kids do
  58.         if kids[i]:IsA("Script") or kids[i]:IsA("LocalScript") then
  59.             if kids[i].Disabled == false then
  60.             younfreezeme[unfrze] = kids[i]
  61.             --print(younfreezeme[unfrze].Name)
  62.             unfrze = unfrze + 1
  63.             end
  64.         end
  65.     end
  66. end)
  67. function unfreezeplr(thing)
  68.     for i=1,#thing do
  69.         if thing[i]:IsA("BasePart") then
  70.             thing[i].Anchored = false
  71.         end
  72.     end
  73.     local ii=1
  74.     while ii<unfrze do
  75.         younfreezeme[ii].Disabled = false
  76.         --print(younfreezeme[ii].Name.." was unfrozen")
  77.         ii=ii+1
  78.     end
  79.     end
  80. function stoptime(thing)
  81. for i, v in pairs(thing) do
  82.     if thing[i]:IsA("BasePart") then        
  83.         if thing[i].Anchored == false then
  84.                  if (thing[i] ~= kids[i]) then
  85.                 thing[i].Anchored = true
  86.                 --print(thing[i].Name.." was anchored")
  87.                 frozen[fzn] = thing[i]
  88.                 fzn = fzn+1
  89.                 end
  90.         end
  91.     end
  92.         if thing[i]:IsA("Humanoid") then
  93.             if thing[i].Parent ~= parent then
  94.             print("Found one")
  95.             local iced = script.Freeze:Clone()
  96.             iced.Parent = thing[i].Parent
  97.             iced.Disabled = false
  98.             end
  99.         end
  100.     if thing[i]:IsA("Script") or thing[i]:IsA("LocalScript")  and thing.Name ~= "Freeze"  then
  101.         if thing[i].Disabled == false then
  102.             if thing[i] ~= script then
  103.                 if (thing[i] ~= younfreezeme[i]) then
  104.             thing[i].Disabled = true   
  105.             --print(thing[i].Name.." was Disabled")
  106.             stopedscript[fzn2] = thing[i]
  107.             fzn2=fzn2+1
  108.                 end
  109.                 end
  110.         end
  111.     end
  112. end
  113. end
  114. function unfreezeall()
  115.     for i=1,#frozen do
  116.         frozen[i].Anchored = false
  117.     end
  118.     for i=1,#stopedscript do
  119.         stopedscript[i].Disabled = false
  120.     end
  121.     fzn = 1
  122.     fzn2 = 1
  123.     frozen = {}
  124.     stopedscript = {}
  125.     print("successfully unfroze everyone!")
  126. end
  127. script.Parent.Activated:Connect(function()
  128.     print(freeze)
  129.     if freeze == true then
  130.         freeze = false
  131.         script.Parent.Handle.Sound:Play()
  132.         script.Parent.Message.Text = "Za Warudo! (The World!)"
  133.         wait(2)
  134.         local gw = game.Workspace:GetDescendants()
  135.         print("freezing everyone now")
  136.         script.Parent.Message.Text = ""
  137.             stoptime(gw)
  138.             unfreezeplr(kids)
  139.             local newsc = script.TimeStop:Clone()
  140.             newsc.Parent = script.Parent
  141.             newsc.Disabled = false
  142.             script.Parent.cooleffects.Disabled = false
  143.             FlashBang()
  144.     wait(6)
  145.     script.Parent.Handle.TimeResume:Play()
  146.     local texty = Instance.new("Message",game.Workspace)
  147.     texty.Text = "Toki wa Ugokidesu... (Time flows again...)"
  148.         wait(2)
  149.         texty:Remove()
  150.         unfreezeall()
  151.         script.Parent.cooleffects.Disabled = true
  152.         freeze = true
  153.         end
  154. end)
  155. human.HealthChanged:Connect(function()
  156.     if human.Health == 0 then
  157.             unfreezeall()
  158.             script.Parent.Handle.TimeResume:Play()
  159.             wait(2.1)
  160.             unfreezeall()
  161.             end
  162. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement