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

How could I make a money system in my game? [closed]

Asked by 8 years ago

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

0
Have you tried doing it yourself? It's actually a really easy script using leader stats. User#11440 120 — 8y
0
Please do not use this for request. JamesLWalker 297 — 8y

Closed as Not Constructive by koolkid8099, Uroxus, and BlackJPI

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 8 years ago

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
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. User#11440 120 — 8y
0
Better? LegendaryBossYT 0 — 8y
Ad