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

Why wont this Script add 1 tap per touch?

 Script (Wont add one tap per touch)

script.Parent.Touched:connect(function()

for_,ipairs(game.Players:GetPlayers)

if Player:FindFirstChild("leaderstats") then

Player.leaderstats.taps.Value = Player.leaderstats.taps.Value +1

Player.leaderstats.taps.Value = Player.leaderstats.taps.Value +1

end

end)



	
	

2 comments

0

add code tags

0

I recommend WaitForChild instead of FindFirstChild

1 answer

✓ Accepted answer

you should do

script.Parent.Touched:connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if plr then
		plr.leaderstats.taps.Value = plr.leaderstats.taps.Value + 1
	end
end)

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