NETWORTH ( works as experience points ) There are specific money bag(tools in game.ServerStorage.Storage)
You don't lose XP, but once you reach a certain amount, you unlock (item)
Is there a better way that I can do this involving a table or something(because this doesn't work past the first one)
1 | stats.NetWorth.Changed:connect( function () |
2 | if networth < 7500 then |
3 | givebag(p, "Starter Money Bag" , "none" ) -- player, bag, removebagtype |
4 | elseif networth < 50000 and networth > 7500 then |
5 | givebag(p, "Rookie Money Bag" , "Starter Money Bag" ) |
6 | end |
7 | end ) |
Here is something I came up with. As long as you list the ranks in order (ascending), updateRank()
will keep track of which rank you're on and automatically call givebag()
when a change in rank is detected.
01 | local p = ... |
02 | local currentRank |
03 | local ranks = -- Array of ranks, in ascending order |
04 | { |
05 | { |
06 | NetWorth = 0 , |
07 | Bag = "Starter Money Bag" , |
08 | } , |
09 | { |
10 | NetWorth = 7500 , |
11 | Bag = "Rookie Money Bag" , |
12 | } , |
13 | { |
14 | NetWorth = 50000 , |
15 | Bag = "Another Money Bag" , |