I have a leaderstats money currency script, but it is fine, working. Now I wish to increase the value of the currency for a player by clicking on an object with ClickDetector. I'm struggling with it, help please ?
local Loot = script.Parent
local Player = game.Players.LocalPlayer
local Cash = Player.leaderstats.IntValue
local Stats = Player.leaderstats
Cash.Parent = Stats
Stats.Parent = Player
function OnClicked()
Cash.Value = Cash.Value+10
end
Loot.ClickDetector.MouseClick:connect(OnClicked)

6 comments
Are you trying to clone Cash and Stats into player?
No, that's done, I'm trying to increase the value
Why are you moving things around to either the same place or somewhere new after setting a variable?
Because I don't know how I could increase the value ! The currency script was made by another script !
Hmm did you try removing lines 6 and 7?
Yes