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

Help with screen GUI text issue?

I'm trying to make a screen GUI on my obby to tell which stage out of all of them they're on.

local stageread = Instance.new("ScreenGui")
stageread.Parent = script.Parent

local player = game.Players:playerFromCharacter(script.Parent)
local text = Instance.new("TextLabel")
text.Parent = stageread
text.Position = UDim2.new(0, 10, 0, 5)
text.Size = UDim2.new(0, 200, 0, 100)
text.Font = "Arial"
text.FontSize = "Size24"
text.Text = .. player.leaderstats.Stage.Value .. "Of 14"

Everything works except for the text. I already have stated what the player I think that I'm calling the data to text wrong. Someone help?

1 answer

✓ Accepted answer

Simple fix, you need to keep the value closed under parentheses or it will not work.

Also I would prefer you use a LocalScript, that way this can work for all players, currently it does not. The new one below only works for LocalScripts

local stageread = Instance.new("ScreenGui")
stageread.Parent = script.Parent

local player = game.Players.LocalPlayer --Retrieves any Player
local text = Instance.new("TextLabel")
text.Parent = stageread
text.Position = UDim2.new(0, 10, 0, 5)
text.Size = UDim2.new(0, 200, 0, 100)
text.Font = "Arial"
text.FontSize = "Size24"

text.Text = (" "..player.leaderstats.Stage.Value.. " Of 14")

8 comments

0

Still having issues with it

0

'Unexpected symbol near '..''

0

Oh I see

0

Do you know how to fix that?

0

I edited it

0

Did it work, because if it did, please press Answered to avoid more answers lol

0

It worked, thanks.

0

Yay! Your welcome :)

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