Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is player only seen in one place?

Asked by 6 years ago
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.

0
what would 'script.Parent.Parent.Parent.Parent.Parent.Parent' equal to? Is the script in the correct place? DevOverr 15 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Found an answer nevermind.

Ad

Answer this question