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

I cannot get the billboard gui to update while playing the game in roblox studio can someone help?

here is the link to a image of the problem https://ibb.co/g3LpvfH

here is the script:game.StarterGui:WaitForChild('BillboardGui').TextLabel.Text = 'Level '.. level.Value

keep inmind this a part of the already made level system

2 answers

You are trying to get the gui in game.StarterGui

The contents in StarterGui is what the player spawns with. You can simply fix it by changing the path to Player.PlayerGui which is the GUIs that the player sees

local Player = -- put player path here

Player:WaitForChild('PlayerGui'):WaitForChild('BillboardGui').TextLabel.Text = 'Level '.. level.Value

Now, to update the Gui every time your level changes. You can use the GetPropertyChangedSignal to detect when a certain property is changed in an instance

So,

local Player = -- put player path here


level:GetPropertyChangedSignal('Value'):Connect(function()
	Player:WaitForChild('PlayerGui'):WaitForChild('BillboardGui').TextLabel.Text = 'Level '.. level.Value

end

2 comments

0

edited

Well, part of it is that you have no loop to keep your script updated. What I would do is put in a "while true do" loop, with a "wait" statement in the loop. Also, you'll want to follow what the other guy is saying, but I would also put the script inside the text label you want to have updating. But take what I'm saying with a grain of salt, because I'm only 60% sure I know what you're trying to say.

local Player = -- put player path here

while true do
	level:GetPropertyChangedSignal('Value'):Connect(function()
	Player:WaitForChild('PlayerGui'):WaitForChild('BillboardGui').TextLabel.Text = 'Level '.. level.Value
	wait(1)
end

1 comment

0

when i do while true do with the wait it says this Script timeout: exhausted allowed execution time

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