while wait() do local player = game.Players.LocalPlayer script.Parent.Text = "Strength:" ..player:WaitForChild("leaderstats"):FindFirstChild("Strength").Value end This is in a local script and local script in a text label I am trying to put the leaderstats in a gui for my simulator game but its not working its giving me the error:Infinite yield possible on 'Players.Player1:WaitForChild("leaderstats")' please help
I have the way I got leader stats: game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local strength = Instance.new("NumberValue") strength.Name = "Strength" strength.Parent = leaderstats
Here is something to try. Make sure your leaderstats script isn't erroring. Then do this for the local script instead:
while wait() do local Plr = game.Players.LocalPlayer local stats = Plr:WaitForChild("leaderstats") local Strength = stats:WaitForChild("Strength") script.Parent.Text = "Strength: " .. Strength.Value end