Advertisement
KashTheKingYT

Gui Manage Script

Jun 13th, 2021
1,665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. local gui = script.Parent
  2. local prisonerFrame = gui:FindFirstChild("Prisoner")
  3. local guardFrame = gui:FindFirstChild("Guard")
  4.  
  5. local changeRemote = game.ReplicatedStorage:FindFirstChild("ChangeTeam")
  6.  
  7. function changeTeam(team)
  8.     changeRemote:FireServer(team)
  9. end
  10.  
  11. prisonerFrame.ChangeTeam.Activated:Connect(function()
  12.     changeTeam("Prisoner")
  13. end)
  14. guardFrame.ChangeTeam.Activated:Connect(function()
  15.     changeTeam("Guard")
  16. end)
  17.  
  18. changeRemote.OnClientEvent:Connect(function(guiEnabled)
  19.     gui.Enabled = guiEnabled
  20. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement