fy812d
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 379 |
|
|
| 09 Mar 2015 09:49 PM |
Is there a better way of getting this done?
I know there should be a more efficient method instead of this.
Thank you guys!
-fy812d
---------------------------------- Script Start------------------------- if not player:IsInGroup(GroupId) then cash.Value = "0" elseif player:GetRankInGroup(GroupId) == 2 then cash.Value = rankCp[2] elseif player:GetRankInGroup(GroupId) == 3 then cash.Value = rankCp[3] elseif player:GetRankInGroup(GroupId) == 4 then cash.Value = rankCp[4] elseif player:GetRankInGroup(GroupId) == 5 then cash.Value = rankCp[5] elseif player:GetRankInGroup(GroupId) == 6 then cash.Value = rankCp[6] elseif player:GetRankInGroup(GroupId) == 7 then cash.Value = rankCp[7] elseif player:GetRankInGroup(GroupId) == 8 then cash.Value = rankCp[8] elseif player:GetRankInGroup(GroupId) == 10 then cash.Value = rankCp[9] elseif player:GetRankInGroup(GroupId) == 20 then cash.Value = rankCp[10] elseif player:GetRankInGroup(GroupId) == 30 then cash.Value = rankCp[11] elseif player:GetRankInGroup(GroupId) == 40 then cash.Value = rankCp[12] elseif player:GetRankInGroup(GroupId) >= 40 then cash.Value = rankCp[14] end ---------------------------------- Script End------------------------- |
|
|
| Report Abuse |
|
|
| 09 Mar 2015 11:20 PM |
local values = { [1] = rankCp[1]; [2] = rankCp[2]; ['X'] = rankCp['Y'] }
local function SetValue(player, stat) local value = values[player:GetRankInGroup(GroupId)] or 0 stat.Value = value end
|
|
|
| Report Abuse |
|