Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

vaild member of meshpart?

Asked by 3 years ago
1script.Parent.Touched:Connect(function(hit)
2    local level = hit.leaderstats.level
3    level.Value = level.Value + 1
4 
5 
6end)

please help me fix?

1 answer

Log in to vote
0
Answered by
Rukreep 15
3 years ago

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:

1local level = hit.Parent.leaderstats.level

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

1local level = hit.Parent:WaitForChild("leaderstats").level
0
i did that but it says infinite yield abdulw12 8 — 3y
0
Where is leaderstats stored at? Rukreep 15 — 3y
0
in a part (workspace abdulw12 8 — 3y
Ad

Answer this question