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

How do i fix leaderstats is not a valid member of player?

local Player = game.Players.LocalPlayer

local points = Player.leaderstats.Points

4 comments

0

Please explain clearer. We don't know what problem you wrong.

0

ok

0

it says that leaderstats is not a valid member of folder

0

Done I did an answer, hope I helped.

1 answer

Ok, I was so confused, Now I finally know what you mean.

Honestly, leaderstats are not a part of Player. If you want to create a leaderstats, insert a script In ServerScriptService.

The script:

game.Players.PlayerAdded:connect(function(p) -- p means player
 local stats = Instance.new("IntValue")
 stats.Name = "leaderstats"
 stats.Parent = p
 
 local money = Instance.new("IntValue")
 money.Name = "Points" -- Change "Points" to other things that you wanted
 money.Value = 50 -- Change the value to how many you want when the player joins the game
 money.Parent = stats 
end)

You can't just find leaderstats inside Player, so just creates them!

Hope I helped, and please explain clearer next time! Cya!

2 comments

0

ok thx

0

np and if worked then accept the answer

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