I want to make it so that the textlabel displays the player’s team and group rank but I keep getting this error:
Players.LMVM2041.PlayerGui.Cash.TextLabel.LocalScript:8: attempt to concatenate Instance with string
Code
repeat wait() until game.Players.LocalPlayer.Character
local grouprank = game.Players.LocalPlayer:GetRankInGroup(11187872)
local team = game.Players.LocalPlayer.Team
local text = script.Parent.Text
while wait(1) do
text = "Current Team: "..team.." | Group Rank: "..grouprank
team:GetPropertyChangedSignal("Team"):Connect(function()
text = "Current Team: "..team.." | Group Rank: "..grouprank
end)
end
Code is a local script inside of the textlabel. Can anybody help? I can’t identify the error.
setting the text variable will not update the property, it will only change the variable, so you need to change local text = script.Parent.Text to be local text = script.Parent and when you need to change the property, do text.Text
team is a Team instance, so you’re mostly likely needing to do team.Name when concatenating
Your GetPropertyChangedSignal will error because Team instances don’t have a team property, I think you meant to use it on the localplayer
Also, something else, I dont think you need the repeat wait() until game.Players.LocalPlayer.Character line, you don’t use the localplayer’s character anywhere