Jump to content

Variable problem


Albinix

Recommended Posts

Is it possible to make a variable of two strings/numbers like this:

for i, playerdata in ipairs(topexp) do 
    guiSetText("expexp"..tostring(i),tostring(playerdata.Exp).." Exp") 
end 

insted of:

for i, playerdata in ipairs(topexp) do 
if (i == 1) then 
    guiSetText(expexp1,tostring(playerdata.Exp).." Exp") 
elseif (i == 2) then 
    guiSetText(expexp2,tostring(playerdata.Exp).." Exp") 
elseif (i == 3) then 
    guiSetText(expexp3,tostring(playerdata.Exp).." Exp") 
elseif (i == 4) then 
    guiSetText(expexp4,tostring(playerdata.Exp).." Exp") 
  
and so on... 
  
elseif (i == 20) then 
    guiSetText(expexp20,tostring(playerdata.Exp).." Exp") 
end 
end 

Hope you understand my question :P

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