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

How Would I Make A Max Currency Script/ Full Bag Script?

Asked by 4 years ago

I'm trying to the player have a cap limit to the amount of currency they can have/ They can't go beyond a certain point.

For Example, if the player's Currency goes over 10 then the Currency won't change.

I tried doing this but my script doesn't seem to work?

game.Players.PlayerAdded:Connect(function(plr)
    local leaderstats = Instance.new("Folder", plr)
    leaderstats.Name = "leaderstats"

    local folder = Instance.new("Folder",plr)
    folder.Name = "ValueHolder"

    local Coins = Instance.new("NumberValue", leaderstats)
    Coins.Name = "Coins"
    Coins.Value = 0

    local Leaf = Instance.new("IntValue", leaderstats)
    Leaf.Name = "Leaf"
    Leaf.Value = 10

    local MaxLeaf = Instance.new("IntValue", folder)
    MaxLeaf.Name = "MaxLeaf"
    MaxLeaf.Value = 25

    local BagFull = Instance.new("BoolValue", folder)
    BagFull.Value = false

    local Ranks = Instance.new("StringValue", leaderstats)
    Ranks.Name = "Rank"

    Leaf.Changed:connect(function()
        if Leaf.Value >= MaxLeaf.Value then
            Leaf.Value = MaxLeaf.Value
            BagFull = true
            print("Players Bag Is Full!")
        else
            BagFull = false
        end
    end)


end)
0
Figured it out : Jomeliter 55 — 4y
0
This won't fix it but, use :Connect() not :connect(). WideSteal321 773 — 4y

Answer this question