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

workspace how make click detector script collect?

Asked by 4 years ago

Leaderboard script workspace:

game.Players.PlayerAdded:connect(function(plr)
    local f = Instance.new("Folder", plr)
    f.Name = "leaderstats"
    local coins = Instance.new("IntValue", f)
    coins.Name = "Coins"
    coins.Value = 0
end)

Coin(button) part workspace: What's wrong with this code? every time I click, I should collect 1p +, but it doesn't work so what changes should this code make to work?

button = script.Parent
local db = true
function onClicked(player)
if workspace:FindFirstChild("Humanoid") then
if db then
db = false
script.Parent.Transparency = 1
local player = game.Players:GetPlayerFromCharacter(onClicked(player))
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 20
wait(1)
script.Parent:Remove()
end
end
end
button.ClickDetector.MouseClick:Connect(onClicked)
0
sorry what do you mean by that? i am sorry i don't understand what you mean? Harry_TheKing1 325 — 4y
0
I put the script, I want to make it work. darkeyescr 7 — 4y
0
ok Harry_TheKing1 325 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

I May Have Your Answer I Made A YouTube Video On How To Do It If You Have Any Problems Comment On The Video Or Tell Me Here (Scripting Helpers).

Link To Video: https://youtu.be/f4bPwMEzIoE/

0
Did It Help You? Harry_TheKing1 325 — 4y
0
Yes, that was it, I think it helped me, now I will implement it, if going in the video means that he has to go to me too. thank you very much for the video tutorial, I hope video to help people as much as possible. darkeyescr 7 — 4y
0
yes me too Harry_TheKing1 325 — 4y
0
If You Need Any More Tutorials You Can Reach Out To Me On Discord At: Harry_TheKing1#2303 Harry_TheKing1 325 — 4y
View all comments (2 more)
0
Cristi_idkikr darkeyescr 7 — 4y
0
I have not yet managed to make it work, it does not show me leaderboardu to me. it would be useful if you put all the code in the description, but still do not know why it does not display leaderboard. darkeyescr 7 — 4y
Ad

Answer this question