Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make this GUI show your team and GUI? I've already tried a script myself.

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

4 comments

0

Could you explain what your problem is? You mentioned your attempt at a script without providing the result you got.

0

you can see the problem with the single line of script he gave

0

Okay, you know those GUIs that display your information? Like name, etc. They sometimes have like this "team" or in [group name] bla bla bla, I'm trying to make something like that. @BlueGrovyle

0

Updated, showing contents.

2 answers

✓ Accepted answer
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.

7 comments

0

P.S. that GUI looks good ;)

0

P.S. that GUI looks good ;)

0

Thanks! :D

0

Does it have to be a local script or a normal script?

0

sorry, i just saw your comment now. it does have to be a local script but you can make it so it does. ill edit my answer to explain.

0

if you want i can make an example. BUT i do really recommend just using the local script in terms of performance

0

it doesnt work any of them, it displays their team in the text, thats what i want, and i've tried the local script but idk

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

1 comment

0

:Children() is deprecated. Use “:GetChildren()” instead

This discussion is preserved as it was. New answers, comments, and votes are closed.