Advertisement
KashTheKingYT

Local Script Manage Team

Dec 5th, 2021
2,163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. local gui = script.Parent
  2. local buttons = gui:GetChildren()
  3.  
  4. for _,button in pairs(buttons) do
  5.     if button:IsA("GuiButton") then
  6.         button.Activated:Connect(function()
  7.             local success = game.ReplicatedStorage.TeamChange:InvokeServer(button.Name)
  8.             if success ~= true then
  9.                 gui.Error.Visible = true
  10.                 wait(1)
  11.                 gui.Error.Visible = false
  12.             else
  13.                 gui.Success.Visible = true
  14.                 wait(1)
  15.                 gui.Success.Visible = false
  16.             end
  17.         end)
  18.     end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement