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

Can someone fix this script?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
local ting = false --debouncer

function onClicked(player)

    if not ting then --debounce check
    ting = true--activate debounce

    local stats = player:findFirstChild("leaderstats") 

    if stats then --If moneyholder exists then
        local cash = stats:findFirstChild("PartsClicked")
        cash.Value  = cash.Value + 1
    end

    ting = false --remove debounce
    end

end

script.Parent.MouseClick:connect(onClicked)

its supposed to give you cash but it no work

0
Why did this get -1 reputation?! blockhaak2 1 — 9y

1 answer

Log in to vote
0
Answered by
jakedies 315 Trusted Moderation Voter Administrator Community Moderator
9 years ago

Put a ClickDetector in the part and do: script.Parent.ClickDetector.MouseClick:connect(onClicked)

Ad

Answer this question