How do i avoid making 10 different else ifs for a group??
elseif Rank == 1 then
elseif Rank == 2 then
elseif Rank == 3 then
Then it goes on and on. How do make this script smaller?
How do i avoid making 10 different else ifs for a group??
elseif Rank == 1 then
elseif Rank == 2 then
elseif Rank == 3 then
Then it goes on and on. How do make this script smaller?
My favorite method is using tables, you can assign values to each position of the table, I am not going to be explaining them so I recommend just googling them on lua.org or on the roblox dev wiki.
Here's a small code example:
local tab = {"Blue", "Red", "Yellow"} -- 1 = Blue, 2 = Red, 3 = Yellow
color = tab[number] -- if it's 1 ==> Blue, etc.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thank you.