Jump to content

[HELP] not work refresh Label


[M]ister

Recommended Posts

Hello again, I added in a gui a label with the name of the player without the color code, and when any player open the gui the label name is updated, (more is not working)

              ... 
local name = string.gsub(getPlayerName(localPlayer), "#%x%x%x%x%x%x", "") 
Label = guiCreateLabel(68, 83, 252, 15, "Your Name: ", false, window) 
function refreshStats() 
    if guiGetVisible(window,true) then 
       guiSetText(Label,"Your Name: "..name) 
    end 
end 
addEventHandler("onClientRender", getRootElement(), refreshStats) 
              ... 

Link to comment

this? It was the first thing I tried, and did not work, I will try again.

Edit: LoL now picked up, I must have done something wrong before :lol:

             ... 
Label = guiCreateLabel(68, 83, 252, 15, "Your Name: ", false, window) 
function refreshStats() 
local name = string.gsub(getPlayerName(localPlayer), "#%x%x%x%x%x%x", "") 
    if guiGetVisible(window,true) then 
       guiSetText(Label,"Your Name: "..name) 
    end 
end 
addEventHandler("onClientRender", getRootElement(), refreshStats) 
              ... 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...