local character = script.Parent.Parent.Parent.Parent.Parent.Parent print("Found character") local player = game.Players:GetPlayerFromCharacter(character) print("Found Player From Character") local Rank = script.Parent function checkRank() if player.Name == "Activatted" or player.Name == "impIosion" then Rank.Text = "Owner" elseif player.leaderstats.OOFs.Value < 5 then Rank.Text = "New" elseif player.leaderstats.OOFs.Value > 5 then Rank.Text = "Rookie" elseif player.leaderstats.OOFs.Value > 10 then Rank.Text = "oof" elseif player.leaderstats.OOFs.Value > 25 then Rank.Text = "Oof" elseif player.leaderstats.OOFs.Value > 50 then Rank.Text = "OOf" elseif player.leaderstats.OOFs.Value > 100 then Rank.Text = "OOF" end end wait(.25) game.Players.PlayerAdded:Connect(checkRank) player.leaderstats.OOFs.Changed:Connect(checkRank)
on last line it will give me the error:
19:14:44.974 - ServerScriptService.NewName.BillboardGui.Frame.TextBox.RankBox.Script:29: attempt to index local 'player' (a nil value)
Doesn't really make sense to me as the variable is defined outside any function.