So, I have a problem, I'm trying to make a Ranking Script (To show the Player Rank above Name) and I (sometimes) get an Error:
Hectiq joined - Debug String 09:05:00.212 - ServerScriptService.Script:7: attempt to index upvalue 'team' (a nil value) - Error 09:05:00.212 - Stack Begin 09:05:00.213 - Script 'ServerScriptService.Script', Line 7 09:05:00.213 - Stack End 09:05:00.942 - ServerScriptService.RankingLabel:7: attempt to index upvalue 'team' (a nil value) - Error 09:05:00.943 - Stack Begin 09:05:00.943 - Script 'ServerScriptService.RankingLabel', Line 7 09:05:00.943 - Stack End
These are My Scripts (TeamList, RankingLabel)
RankingLabel:
local serverStorage = game:GetService("ServerStorage") local bbg = serverStorage:WaitForChild("RankGui") local team = _G.team game.Players.PlayerAdded:Connect(function(player) game.Workspace:WaitForChild(player.Name) if team[player.Name] == "Owner" then local cbbg = bbg:Clone() cbbg.Parent = game.Workspace[player.Name].Head cbbg.Rank.Text = "Owner" cbbg.Rank.TextColor3 = Color3.fromRGB(170,0,0) return elseif team[player.Name] == "Designer" then local cbbg = bbg:Clone() cbbg.Parent = game.Workspace[player.Name].Head cbbg.Rank.Text = "Designer" cbbg.Rank.TextColor3 = Color3.fromRGB(0,0,223) return else local cbbg = bbg:Clone() cbbg.Parent = game.Workspace[player.Name].Head cbbg.Rank.Text = "Player" cbbg.Rank.TextColor3 = Color3.fromRGB(40,40,40) return end end)
TeamList:
_G.team = { ["Hectiq"] = "Owner"; ["CENSORED"] = "Designer"; } return _G.team
It seems you're defining _G.team after the script calling for it. Try adding this before calling for _G.team.
repeat wait() until _G.team