Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

A ranking type script thingy?

Asked by 7 years ago
Edited 7 years ago

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)

1stats.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
7end)

1 answer

Log in to vote
0
Answered by 7 years ago

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.

01local p = ...
02local currentRank
03local 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",
View all 40 lines...
0
You're a life saver. I appreciate it very much. getzedotus 0 — 7y
0
Any chance you can add me on discord? brandon#1169 getzedotus 0 — 7y
0
I'm in the Scripting Helpers Discord server from time to time. gwest2#4333 WillieTehWierdo200 966 — 7y
Ad

Answer this question