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

How do I add money in a game, and if they spend it how would that work? [closed]

Asked by 3 years ago

I am working on a test game but it needs currency to buy certain things

0
I think this site is mainly about scripting issues, before asking a vague question, try searching about your objective, I think this can help you: https://developer.roblox.com/en-us/articles/Leaderboards when you have a scripting question, i will be more than happy to help. Igoralexeymarengobr 365 — 3y

Closed as Not Constructive by Dovydas1118, Soban06, nekosiwifi, and WizyTheNinja

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
-1
Answered by
MattVSNNL 620 Moderation Voter
3 years ago
Edited 3 years ago

We make something called leaderstats here's the script

and btw scripting helpers.Org is not a request site

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

    local coins= Instance.new("IntValue")
    coins.Name = "Coins"
    coins.Value = 0
    coins.Parent = leaderstats
end)

To buy something make a local script in a UI button for example

player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 100

Under here make the script do something

Ad