October 12, 2020, 4:32pm
I’m trying to create a nametag that displays a players stage.
Currently it just shows the stage as 0.
Here is the cloning code:
local nametag = game:GetService("ServerStorage"):WaitForChild("NameTagGui")
char:WaitForChild("Humanoid").HealthDisplayDistance = 0
char:WaitForChild("Humanoid").NameDisplayDistance = 0
local cloneTag = nametag:Clone()
cloneTag.Frame.NameText.Text = plr.Name
cloneTag.Parent = char.Head
The cloning code works.
This is a view of the nametag inside explorer.
Code for local script:
while true do
local CurStage = player.leaderstats.Stage.Value
script.Parent.Text = CurStage
The current code makes it only show local.
Could someone help? Thanks.
There may be some issues with your notes being lines of code and not notes
-- This is a note!
This is code!
do this inside of a normal script:
while wait(0.1) do
local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent.Parent) --change to character it is inside
script.Parent.Text = player.leaderstats.Stage.Value
October 12, 2020, 4:39pm
Strange, doesn’t seem to show, the stage shows as 0 (Default text).
are there any errors in the output?
October 12, 2020, 4:43pm
[Workspace.Inceptual.Head.NameTagGui.Frame.Stage.TextLabel.Script:3: attempt to index nil with ‘leaderstats’]
oh alr, I thought that there were less parents needed, so do it like this instead:
player = game.Players:GetPlayerFromCharacter(script.Parent.Parent.Parent.Parent.Parent.Parent)
until player ~= nil
script.Parent.Text = value
October 12, 2020, 4:48pm
Seems like it worked, Thanks for the help!
No need to do
while wait(0.1) do, IntValues have a
Changed event that fires when the value is changed.
yes, and I wasnt thinking about it at that time. I’ll just update the script.