I would like my GUI
to be visible for a certain team only (bright yellow("Host"))
so I've tried to make a script that will just copy the GUI
in player GUI
01 | local Person = game.Players.LocalPlayer |
02 |
03 | script.Parent.MouseButton 1 Click:Connect( function () |
04 | if Person.Name = = "4581quzwi" then |
05 | workspace.TeamEvents.TeamEvent:FireServer(script.Parent.Text) |
06 | local gui = game.ServerStorage.Host |
07 | gui.Parent = Person.PlayerGui; |
08 |
09 |
10 | end |
11 | end ) |
but for some reason, thee Gui always deletes itself (I've tried Replicated server storage lightning and workspace)
can anyone please help me with the issue or the script
-4581quzwi
1 | game.Players.PlayerAdded:Connect( function (player) |
2 | If player.Team = = "TeamName" then |
3 | script.Parent.Visible = true |
4 | else |
5 | script.Parent.Visible = false |
6 | end |
7 | end ) |
Please let me know if you need any help.
Not sure but i think its:
1 | if game.Players.Localplayer.Team = = "team1" then |
2 | script.Parent.Visible = true |
make sure to put the above in the gui (localscript)
if you are trying to do certain players use this:
1 | --//Lead Scripters |
2 |
3 |
4 | local admins = { "player1" , "player2" } |
5 |
6 | game.Players.PlayerAdded:Connect( function (player) |
7 | for i = 1 , #admins do |
8 | if admins [ i ] = = player.Name then |