Hello, I was wondering how to get leaderstats from hit.Parent.
What I mean by this is I want when somebody touches a block they get a point, but I don’t know how to get the leaderstats.
Hello, I was wondering how to get leaderstats from hit.Parent.
What I mean by this is I want when somebody touches a block they get a point, but I don’t know how to get the leaderstats.
If you know that leaderstats is stored in each player directly, you would usually get the player first and then the leaderstats. In assumption that you used game:GetService("Players")…
Players:GetPlayerFromCharacter(hit.Parent) -- Does not guarantee player, because sometimes hit.Parent isn't a character
With the function above, you can reference player.leaderstats or use FindFirstChild() if you’re not sure.