So I expected this script :
humanoid = game.Players.LocalPlayer.Character.Humanoid
level = game.Players.LocalPlayer.leaderstats.Level
humanoid.MaxHealth = 100 + (level * 2)
to set my health to 102 (because my level is 1) but it gives me this error : leaderstats is not a valid member of Player What's wrong? leaderstats script
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local level1 = Instance.new("IntValue")
level1.Name = "Level"
level1.Value = level:GetAsync(key)
level1.Parent = leaderstats
local gold1 = Instance.new("IntValue")
gold1.Name = "Gold"
gold1.Value = gold:GetAsync(key)
gold1.Parent = leaderstats
That isn't the whole thing, but I think that'll help out

2 comments
I found my own fix, All I did was added : game.Players.LocalPlayer:WaitForChild("leaderstats")
alright