Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Help with screen GUI text issue?

Asked by
Scootakip 299 Moderation Voter
8 years ago

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

Log in to vote
-1
Answered by 8 years ago

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")
0
Still having issues with it Scootakip 299 — 8y
0
'Unexpected symbol near '..'' Scootakip 299 — 8y
0
Oh I see PancakeChop 35 — 8y
0
Do you know how to fix that? Scootakip 299 — 8y
View all comments (4 more)
0
I edited it PancakeChop 35 — 8y
0
Did it work, because if it did, please press Answered to avoid more answers lol PancakeChop 35 — 8y
0
It worked, thanks. Scootakip 299 — 8y
0
Yay! Your welcome :) PancakeChop 35 — 8y
Ad

Answer this question