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

It shows up an error when I try to make a label that displays teams, help!?

Hello, I know the title is confusing but I am trying to make a label display a text.

Error: "18:12:47.627 - Players.iiLevelMaker.PlayerGui.HUD.Frame.Level.LocalScript:10: attempt to concatenate field 'Team' (a userdata value)"

Script:

local player = game.Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui"):WaitForChild("HUD")
local label = gui:WaitForChild("Frame").Level

game.Players.PlayerAdded:connect(function()
	label.Text = "Level: "..player.Team
end)

game:GetService("RunService").RenderStepped:connect(function()
	label.Text = "Level: "..player.Team
end)

I tried doing player.Team.Value and player.Team.Text but neither works. Help me!

1 answer

✓ Accepted answer

I think it's because you have to turn that value into a string, try this:

label.Text = "Level: "..tostring(player.Team.Value)

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