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?
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")