I don't understand why I am getting this warning, my leaderstats folder is in the player.
game.Players.PlayerAdded:connect(function(player) local nextstage = workspace:WaitForChild("Stage"..(player.leaderstats.Stage.Value+1)) local stage = workspace:WaitForChild(player.leaderstats.Stage.Value) wait() nextstage.BrickColor = BrickColor.new("Shamrock") end)
How are you creating the leaderstats folder? If you're creating it through scripts it should be
game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player end)
in a Script in ServerScriptService. What this does is creates a folder in the player ever time a player joins.
You don't need the player's character for this script to work so it should be like this:
game.Players.PlayerAdded:Connect(function(player) local leaderstats = player:WaitForChild("leaderstats") local stage = leaderstats:WaitForChild("Stage") local value = stage.Value local nextstage = workspace:WaitForChild("Stage"..player.leaderstats.Stage.Value + 1) wait() nextstage.BrickColor = BrickColor.new("Shamrock") end)