So I am creating a game with a game currency. In my leaderboard in which I have two types of currency, coins and jewels but I am having trouble scripting so that if I click on a gem, it makes the gem disappear and for one gem be added to the jewel leaderboard.
Does any of that make sense?
function onClick() check = script.Parent.MousButton1Down:FindFirstChild("Humanoid") if check ~= nil then local stats = user:findFirstChild("leaderstats") if stats ~= nil then local cash = stats:findFirstChild("Jewels") cash.Value = cash.Value +1 script.Parent.Visible = false end
script.Parent.MouseButton1Down:connect(OnClick)
I am well aware that this might not even be remotely correct. This is based on other free scripts I found but they were for a human touching the brick so I tried to adapt it to clicking but I probably did that wrong. Overall I have no idea what I am doing.