Refreshing player info (in UI) not working

Hey all,
I was making a UI display some data from the player, but couldn’t get this to refresh when the player resets their character or joins the game

I have tried a couple of things but nothing seemed to work. I’m now stuck at the following:

Player.CharacterAdded:Connect(function()
	if Player.Team == Groups.TeamName1 then
		if Player:IsInGroup(Groups.ID1) then
			local Rank = Player:GetRoleInGroup(Groups.ID1)
			RankUI.Text = Groups.Text1 .. " - " .. Rank
		else
			RankUI.Text = DefaultTeam .. " - " .. "Guest"
		end
	end
-- This x8 just with other groups and texts, in an 'elseif'.
end)

(‘Groups’ is a table)

The ‘CharacterAdded’ doesn’t seem to trigger anything. Nothing is updating if I join or reset.
The rest of it does work, although it might be possible to simplify/make shorter.

Any help much appreciated!

EDIT: I am using this in a localscript

2 Likes

I am pretty positive that “Player.Team” references and instance, try switching it to “Player.Team.Name” and make sure that the player is actually on that team.

Yeah I changed that right after I posted this (:
Thanks though

1 Like

I used Player:GetPropertyChanged("Team") and this fixed it all. (Solution by Bestger08)
Don’t take my code as an example please, this is far from refined and you will learn more by doing it yourself.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.