Jump to content

Refreshing Class on Custom Scoreboard


Recommended Posts

Posted

I made a custom scoreboard, and I have set element data's but I am trying to refresh it on my scoreboard, because if player changes class then it should change on scoreboard -

I get no errors -

Client Side

function refresh() 
data = getElementData(getLocalPlayer(), "Class") 
end 
setTimer ( refresh, 51, 0 ) 
  
dxDrawText(data, classx, y+i*20.5) 
  

It's frozen as the previous class and doesnt change

Posted
addEventHandler("onClientRender", getRootElement(), function() 
    dxDrawText(getElementData(getLocalPlayer(), "Class"), classx, y+i*20.5); 
end); 

much better! :)

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted
I dont need client renders,

I wanted to know if that was the right way to refresh the element data, I have my renders already.

You didn't got me, instead of refreshing the data by a timer you can just replace data variable with "getElementData(getLocalPlayer(), "Class")" in your event.

onClientRender event is already like a timer that update enywhere from 25-100 (depends of how many fps you have) times a second.

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted

all what you need is :

-- Function  
getElementData() 
setElementData() 
getAccountData() 
setAccountData() 
  
-- Events 
onPlayerQuit 
onPlayerLogin 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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...