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

How do I make it so when I touch a brick it adds +1 wins to the local player (in leaderstats)?

I know I would use the Touched event but I don't know what to put after.

1 answer

✓ Accepted answer

You would put exactly what you think you'd put. (At least I hope you'd think so)

Find the reference to your leaderstats object then increment the wins property, if you have one set. I'm not sure exactly how you structured it but if you are counting wins using an IntValue, then you would have to reference that object and increment it.

local part = script.Parent
part.Touched:Connect(function(touchedPart)
	-- [[ --
	get player of touchedPart
	find wins (IntValue) for that player
	wins.Value = wins.Value + 1
	-- ]] --
)

That's the basic idea of what you'd do. I would need to see more of how you did your leaderstats to give you a more specific example, but I hope this helps.

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