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
local Person = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() if Person.Name == "4581quzwi" then workspace.TeamEvents.TeamEvent:FireServer(script.Parent.Text) local gui = game.ServerStorage.Host gui.Parent = Person.PlayerGui; end 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
game.Players.PlayerAdded:Connect(function(player) If player.Team == "TeamName" then script.Parent.Visible = true else script.Parent.Visible = false end end)
Please let me know if you need any help.
Not sure but i think its:
if game.Players.Localplayer.Team == "team1" then script.Parent.Visible = true
make sure to put the above in the gui (localscript)
if you are trying to do certain players use this:
--//Lead Scripters local admins = {"player1","player2"} game.Players.PlayerAdded:Connect(function(player) for i = 1, #admins do if admins[i] == player.Name then