Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

workspace how make click detector script collect?

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)

3 comments

0

sorry what do you mean by that? i am sorry i don't understand what you mean?

0

I put the script, I want to make it work.

0

ok

1 answer

✓ Accepted answer

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/

6 comments

0

Did It Help You?

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.

0

yes me too

0

If You Need Any More Tutorials You Can Reach Out To Me On Discord At: Harry_TheKing1#2303

0

Cristi_idkikr

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.