Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] How to update a TextLabel?

Asked by 3 years ago
Edited 3 years ago

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!

0
Player.Level.Changed:Connect(function() Tastytoastplayz 0 — 3y
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 Tastytoastplayz 0 — 3y
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! trainjedi 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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.

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

Answer this question