Hi, so I wanted to create a GUI to tell players which stage they are on in my obby. I put this script in a local script that’s in the text label that I want it to be shown in. For some reason its not working.
local plr = game.Players.LocalPlayer
local playerStage = plr.Stage
local textDisplay = script.Parent.TextLabel
textDisplay.Text = playerStage.Value
playerStage.Changed:Connect(function(newValue)
textDisplay.Text = playerStage.Value
end)
If anyone can please help it would be greatly appreciated.
Thank You
Just replace it with what you currently have playerStage defined as
local plr = game:GetService('Players').LocalPlayer -- obtain all services with GetService
local playerStage = plr.leaderstats:WaitForChild('Stage')
local textDisplay = script.Parent.TextLabel
textDisplay.Text = playerStage.Value
playerStage:GetPropertyChangedSignal('Value'):Connect(function() -- GetPropertyChangedSignal is a better way to handle these changes
textDisplay.Text = playerStage.Value
end)