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

How would I make this value constantly change?

Ok, so this show's your stage level over your head, it works, but when they move on, it doesn't update..

local serverStorage = game:GetService("ServerStorage")
local billBoardGui = serverStorage:WaitForChild("BillboardGui")

game.Players.PlayerAdded:connect (function(plr)
	
local rank = game.Players.LocalPlayer:WaitForChild("leaderstats" ):WaitForChild("Stage")
	
	plr.CharacterAdded:connect (function(char)
		
local	bgc = billBoardGui:Clone()
		bgc.Frame.TextLabel.Text = "Stage: "..rank.Value
		
		bgc.Parent = workspace:WaitForChild(char.Name) :WaitForChild("Head")
	end)
end)

Example: https://gyazo.com/bd9ca240e5d3adf73767cd2480b35378

Generally i have to reset so it can update to say "Stage 2"

2 answers

You need to add a Changed event to the value. See if this works.

local serverStorage = game:GetService("ServerStorage")
local billBoardGui = serverStorage:WaitForChild("BillboardGui")

game.Players.PlayerAdded:connect (function(plr)

local rank = game.Players.LocalPlayer:WaitForChild("leaderstats" ):WaitForChild("Stage")

    plr.CharacterAdded:connect (function(char)

	local   bgc = billBoardGui:Clone()
	bgc.Frame.TextLabel.Text = "Stage: "..rank.Value

	rank.Changed:Connect(function()
        	bgc.Frame.TextLabel.Text = "Stage: "..rank.Value
	end)

        bgc.Parent = workspace:WaitForChild(char.Name) :WaitForChild("Head")
    end)
end)

5 comments

0

go with his

0

this broke it? now it doesnt show anymore?

0

This should be the same expect for it updating when the value is changed

0

except|

0

yea but now it doesnt show it over head for some reason

You have to constantly be looking for the value of the rank so try a while true do script. I don't have the time to write one atm but you get the jist. Just do a while true do to refresh the rank value.

1 comment

0

no?

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