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

How do you make a regular block add money to leaderboard on click?

Asked by 7 years ago
Edited 7 years ago

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.

0
Add the script, please. OldPalHappy 1477 — 7y
0
Use PlayerWhoClicked as an argument / parameter and a ClickDetector and chech when the player clicked that ClickDetector. nanaluk01 247 — 7y

Answer this question