Hi. I am using this chat tag module and when I test the script, I get the error "Attempt to index nil with PlayerId
The script:
for i,v in pairs(EDM.Players) do
if v['PlayerId'] == nil then
if player.UserId == v['PlayerId'] then
if v['Tag'] ~= nil then
table.insert(tags, v['Tag'])
end
if v['ChatColor'] ~= nil then
if chatColor == nil then
chatColor = v['ChatColor']
end
end
if v['NameColor'] ~= nil then
if nameColor == nil then
nameColor = v['NameColor']
end
end
if v['Rainbow'] ~= nil then
rainbowChat = true
end
end
end
end
The module:
Players =
{
{
PlayerId = 208100335, -- p1xnet
Tag = {TagText = "DEVELOPER", TagColor = Color3.fromRGB(255, 0, 0)},
NameColor = Color3.fromRGB(255, 0, 0),
ChatColor = Color3.fromRGB(255,255,255),
Rainbow = true,
},
PlayerId = 902603595, -- thespecialnone
Tag = {TagText = "DEVELOPER", TagColor = Color3.fromRGB(255, 0, 0)},
NameColor = Color3.fromRGB(255, 0, 0),
ChatColor = Color3.fromRGB(255,255,255),
Rainbow = true,
{
PlayerId = 1026849565, -- b4_stackz
Tag = {TagText = "ADMIN", TagColor = Color3.fromRGB(34, 255, 0)},
NameColor = Color3.fromRGB(255, 0, 0),
ChatColor = Color3.fromRGB(255,255,255),
Rainbow = true,
},
{
PlayerId = 275151861, -- spider
Tag = {TagText = "ADMIN", TagColor = Color3.fromRGB(34, 255, 0)},
NameColor = Color3.fromRGB(255, 0, 0),
ChatColor = Color3.fromRGB(255,255,255),
Rainbow = true,
},
{
PlayerId = 1863625746, -- jail
Tag = {TagText = "ADMIN", TagColor = Color3.fromRGB(34, 255, 0)},
NameColor = Color3.fromRGB(255, 0, 0),
ChatColor = Color3.fromRGB(255,255,255),
Rainbow = true,
},
{
PlayerId = 1411828672, -- rebathing
Tag = {TagText = "MODERATOR", TagColor = Color3.fromRGB(255, 114, 168)},
NameColor = Color3.fromRGB(255, 0, 0),
ChatColor = Color3.fromRGB(0, 76, 255),
},
},