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

vaild member of meshpart?

script.Parent.Touched:Connect(function(hit)
	local level = hit.leaderstats.level
	level.Value = level.Value + 1 

	
end)

please help me fix?

1 answer

When your character touches the part, the first thing that it touches is the part that it was touched by. Basically, if you touch the part with your left leg, it will check the left leg to find "leaderstats". You gotta do:

    local level = hit.Parent.leaderstats.level

And in case it doesn't load for some reason, add:

    local level = hit.Parent:WaitForChild("leaderstats").level

3 comments

0

i did that but it says infinite yield

0

Where is leaderstats stored at?

0

in a part (workspace

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