I know I would use the Touched event but I don't know what to put after.
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.