script.Parent.Touched:Connect(function(hit)
local level = hit.leaderstats.level
level.Value = level.Value + 1
end)
please help me fix?
script.Parent.Touched:Connect(function(hit)
local level = hit.leaderstats.level
level.Value = level.Value + 1
end)
please help me fix?
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
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
i did that but it says infinite yield
Where is leaderstats stored at?
in a part (workspace