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

How to set the text on a textlabel as a group role in a group?

I'm trying to make a little panel that shows, your name, your picture, and your rank, but I can't get it to change. This is the script that I have but it won't work.

game.Players.PlayerAdded:Connect(function(player)

script.Parent.Text = player:GetRoleInGroup(--group ID)

I have this in a LocalScript inside of the text label.

1 answer

✓ Accepted answer

The PlayerAdded event can only be detected on the server, whereas you're using a local script which is run on the client. Since local scripts only run while the player is in the game, you don't need an event that waits for the player to join the game. You can edit your script to look like this:

local player = game:GetService("Players").LocalPlayer
script.Parent.Text = player:GetRoleInGroup(--Group ID)

If you have any questions or problems with this answer, let me know. I'd be happy to clarify or fix it.

Hope this helps!

2 comments

0

Great job, thank you so much!

0

Happy to help

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