Advertisement
Sungmingamerpro13

New Woods System

Mar 17th, 2024
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.68 KB | None | 0 0
  1. local number = 0
  2. local Maxnumber = 10
  3.  
  4. local WoodsGui = script.Parent.PlankInWindow.WoodsGui
  5.  
  6. for i, Window in pairs(script.Parent:GetChildren()) do
  7.     if Window.Name == "Window" then
  8.        
  9.         local Proximity = Window.Proximity
  10.  
  11.         Proximity.Triggered:Connect(function(player)
  12.  
  13.             local Plank = player.Character:FindFirstChild("Plank")
  14.  
  15.             if Plank then
  16.                 Plank:Destroy()
  17.                 number = number + 1
  18.                 WoodsGui.TextLabel.Text = "Woods: "..number.." / "..Maxnumber
  19.             end
  20.            
  21.             if number == Maxnumber then
  22.                 script.Parent.PlankInWindow.Transparency = 0
  23.             end
  24.            
  25.             while wait() do
  26.                 if number == Maxnumber then
  27.                     wait(1)
  28.                     break
  29.                 end
  30.             end
  31.         end)
  32.     end
  33. end
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement