Albinix Posted January 13, 2011 Share Posted January 13, 2011 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 Link to comment
Antibird Posted January 13, 2011 Share Posted January 13, 2011 This should be the way: for i, playerdata in ipairs(topexp) do guiSetText(_G["expexp"..tostring(i)],tostring(playerdata.Exp).." Exp") end Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now