Hi, I'm having a ton of trouble with this script. I want to make a GUI like those GUIs in survival games where it pops up an has all of the names of the players who survived the round. I need my GUI to show the names of all of the players in a team called "Survivors". I have a script (below) but it doesn't work and I'm fairly sure that it is REALLY REALLY wrong so I could really use some help. This script is a regular script inside a text label that is inside of a frame inside the GUI. Thanks in advance, I really appreciate the help, if you have any questions please comment them below and I'll try to answer them ASAP.
local player = game.Teams.Survivors:GetPlayers() while script.Parent.Parent.Parent.Parent.Enabled == true do script.Parent.Text = print.player.Name end
Again, I know this script sucks but I can't figure out how to fix it.
Hello, Skyraider5!
I know how to make this, the following script will do exactaly that:
local teamcolor = "White" -- Team Color for _, plr in pairs(game:GetService("Players"):GetPlayers()) do -- Gets all Players if plr.TeamColor == BrickColor.new(teamcolor) then -- Test every single player team script.Parent.Text = plr.Name .. "," .. script.Parent.Text -- Sets the new label text! end end
This script will get the current text of the box + player name(if in team)
ATTENTION: Script's parent must be the Label/Button it will edit!
I made this other script(This one don't need to be local, and can also be on the workspace =D)
local TeamName = "Team" -- Place the team name here! local TeamColor = BrickColor.new("White") local StartText = "Players in White team:" -- Change to the message gui will start with script.Parent.Text = StartText while wait() do local playersInt = game.Players:GetPlayers() local player = game.Players:GetChildren() local team = game:GetService("Teams"):FindFirstChild(TeamName) local players = team:GetPlayers() for i, plr in pairs(players) do if plr.TeamColor == TeamColor then script.Parent.Text = script.Parent.Text .. "," .. plr.Name end wait(3) if i == #playersInt then script.Parent.Text = StartText end end end
~~ Edit: Added the second Script =D
Good Luck with your games