Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How could I make a money system in my game?

I need to know how to make a money system. I know how to make a team and all, but I don't know how to add those extra things to the right of your name. Please help.

Thanks again, se22an21 :D

2 comments

0

Have you tried doing it yourself? It's actually a really easy script using leader stats.

0

Please do not use this for request.

1 answer

Here is a good script:

game.Players.PlayerAdded:connect(function(player)
    playerLeaderstats[player] = {}
    playerLeaderstats[player]["Money"] = 0
    local leaderstats = Instance.new("Model")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player
    local money = Instance.new("IntValue")
    money.Name = "Money"
    money.Value = playerLeaderstats[player]["Money"]
    money.Parent = leaderstats
end)
 
while wait(5) do 
    for _, player in pairs(game.Players:GetPlayers()) do
        --We don't use the IntValue's value because an exploiter can modify it.
        playerLeaderstats[player]["Money"] = playerLeaderstats[player]["Money"] + 1
        if player:FindFirstChild("leaderstats") then
           player.leaderstats.Money.Value = playerLeaderstats[player]["Money"]
        end
    end
end

2 comments

0

Put your code In a code block. To do this press the blue Lua button and put your code the area provided. What you have right now is impossible to read.

0

Better?

This discussion is preserved as it was. New answers, comments, and votes are closed.