So, I'm trying to make a border game. And I have this "player information" GUI. I am trying to make it so the bottom line shows if your in the group or team, if you can help me with one of those then great! First off, I'll show you the GUI. !Player Information GUI And heres a script I tried to do.
script.Parent.Text = script.Player.Team.Name
Please note I am not good at scripting. Basically, if you choose an option between scripting the group or team then I will pick a script that you guys have said. Please help!
Contents btw !contents If you wanna try out the game then here. https://www.roblox.com/games/3012369787/Papers-Simulator-NEW-MAP
script.Parent.Text = game.Player.LocalPlayer.Team
Alternative :
local Player = game.Player.LocalPlayer script.Parent.Text = Player.Team
You don't really need to add ".Name" in Team.Name. This script only works in local script since i used game.Player.LocalPlayer but you can change it.
script.Parent.Text = script.Player.Team.Name
I also noticed that you did "script.Player.Team.Name" I don't really get what you mean, but I'm guessing that there is an object value in the script if I'm right you could have did this instead :
local Player = script.Player script.Parent.Text = Player.Team
if it was a string value then
local Player = script.Player script.Parent.Text = game.Players[Player.Value].Team
P.S. that GUI looks awesome.
EDIT : You can't access the StarterGUI or the GUI's inside it using a normal script, that is because StarterGUI is cloned into the client which means it wont replicate to the server. So the only way to access it is with a local script, but you can use remote events to do this.
This question has been answered by me! I looked in free models and got this show team gui, I changed some assets in it and now it looks like this.
local team=script.Parent
local player=team.Parent.Parent.Parent
local teams={}
for i,v in pairs(game.Teams:children())do
table.insert(teams,v)
end
while wait(.25)do
for a,b in pairs(teams)do
if b.TeamColor==player.TeamColor then
team.Text=" "..b.Name.." "
end
end
end