game.Players.PlayerAdded:connect(function(Player)
local leaderstats=Instance.new("StringValue")
leaderstats.Parent=Player
leaderstats.Name="leaderstats"
local lvl=Instance.new("IntValue")
lvl.Parent=leaderstats
lvl.Parent=leaderstats
lvl.Name="Level"
repeat wait() until
leaderstats
end)
----
game.Players.PlayerAdded:connect(function(Player)
Player.leaderstats.Level.Changed:connect(function()--line 14
local Debris=game:GetService("Debris")
local Light=Instance.new("PointLight")
Light.Parent=Player.Character.Torso
Light.Brightness=math.huge
Light.Color=Color3.new(255,225,0)
Debris:AddItem(Light,5)
end)
end)
the error is leaderstats is not a valid member of Player on line 14. On ROBLOX studio, you can see the value, but I get this error in both studio and in a server.

2 comments
What is the problem? Describe it with words. What do you think is wrong? What testing have you done? Is there an error?
oh sorry right, I'm out of it right now...