I'm trying to make a button that increases your current currency. I used this guide:
http://wiki.roblox.com/index.php?title=In_Game_Currency#CurrencyManager
And made my own script:
local click = script.Parent.ClickDetector.MouseClick local curman = require(389753980) local currentGold = {} local updatecurev = game.ReplicatedStorage.UpdateCurDis click:Connect(function(player) local balance = curman:GetBalance(player.UserId) + 1 currentGold[player.UserId] = balance updatecurev:FireClient(player, balance) end)
It updates the currency, but it only works once. What do I do?
I would update the gold based off of the current balance (not sure what's going on with the private module):
local click = script.Parent.ClickDetector.MouseClick local curman = require(389753980) local currentGold = {} local updatecurev = game.ReplicatedStorage.UpdateCurDis click:Connect(function(player) local balance = curman:GetBalance(player.UserId) if currentGold[player.UserId] then currentGold[player.UserId] = currentGold[player.UserId] + 1 else currentGold[player.UserId] = balance end updatecurev:FireClient(player, currentGold[player.UserId]) end)