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

How do I make it so the part/Button counts how many times its been clicked?

Asked by 3 years ago

Im Having trouble with the way it highlights code. So instead im going to link my description of my problem:

https://docs.google.com/document/d/1ajzc8M4CDA6IMNvO0GX_Q2uIusjU8u0dtFr-kX39zs8/edit?usp=sharing

Thanks in advance.

1 answer

Log in to vote
0
Answered by 3 years ago

OP, I think the problem you have is the unnessacary use of "local"

Try this in the first script:

script.Parent.ClickDetector.MouseClick:Connect(function(player)
    local PlayerBPs = player.leaderstats.BP
    script.Parent.Text = (PlayerBPs.Value + 1)
end)

I removed the unneeded Locals

Basically, only use Local if you are initiating a varible or function

0
thanks, welp that fixed it! Landonstr 2 — 3y
Ad

Answer this question