local PartTouch = false
game.Workspace.Part.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if test == false then local keys = hit.leaderstats.keys keys.Value = keys.Value + 1 end end end)
but it says in output
leaderstats is not a valid member of MeshPart "Workspace.abdulw12.RightLowerLeg

2 comments
To add to this answer: note that a full script would make sure that there is a player returned from GetPlayerFromCharacter (in case a random object hit the button instead of a player)
im lazy i just pcall it