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

[SOLVED] How to update a TextLabel?

I'm trying to implement a basic Level system for a test on a future project, I've tried solutions from multiple sources however none of them have worked for me. It's being called in a LocalScript.

This is the current script I'm using (doesn't update to what the value is, only shows what I put in the TextLabel as a placeholder):

while true do
	game.PlayerGui.PlayerInfo.Level.Text = "Level ".. game.ReplicatedStorage.Level.Value
end

Originally I was using this and the value would show however it wouldn't update:

script.Parent.Text = "Level ".. game.ReplicatedStorage.Level.Value

Any help would be appreciated!

3 comments

0

Player.Level.Changed:Connect(function()

0

Player.Level.Changed:Connect(function() game.PlayerGui.PlayerInfo.Level.Text = "Level ".. Player.Level.Value end) Hope this Helps, sorry I didn't break the lines, I'm kinda new to this website and dont know how to in a comment

0

Alright cheers! I don't believe you can do a script box in comments however you can do it in answers the same way you do it in questions. All the best!

1 answer

What I'd recommend doing is putting is putting an IntValue in the player on spawn which is their level, and use the Value.Changed event then just use the game.PlayerGui.PlayerInfo.Level.Text = "Level ".. line in the function.

1 comment

0

Alright, cheers! Except I don't actually know how to do a lot of what your suggesting. Could you maybe provide an example?

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