Okay, so recently I have been trying to make a blacklist DSS on roblox, that works when a player says the following command and is a specific rank in a certain group. The only issue I am getting on this is at Line 21 I am getting an error saying: "Attempt to index nil with “Name”. Thank you in advance for any help that is given ![]()
Code:
local blacklistedusers = {1,1,1,1} -- User id not name
local players = game:GetService("Players")
local player = players.LocalPlayer
local dss = game:GetService("DataStoreService")
local blacklistds = dss:GetDataStore("BlacklistedUsers")
-------------------
local groupid = 4170345
local adminrank = 100
for i,v in pairs(game.Players:GetPlayers()) do
for i,banneduserid in pairs(blacklistedusers) do
if v.UserId == banneduserid then
local background = v.PlayerGui.ModCall.Background
background.Call.Visible = false
background.Reason.PlaceholderText = "You are blacklisted from using this, appeal in the discord."
background.Reason.PlaceholderColor3 = Color3.new(0,0,0)
background.Subtitle.Text = "Your are blacklisted"
end
end
end
print(player.Name) -- Part with the error --
player.Chatted:Connect(function(msg)
print(msg)
if msg:sub(1,11) == "/blacklist " and player:GetRankInGroup(groupid) >= 100 then
blacklistds:SetAsync(player.UserId, true)
player:Kick("Your blacklisted from using the Mod Call - NAC :)")
end
if msg:sub(1,13) == "/unblacklist " and player:GetRankInGroup(groupid) >= 100 then
blacklistds:SetAsync(player.UserId, false)
end
end)
game.Players.PlayerAdded:Connect(function(plr)
if blacklistds:GetAsync(plr.UserId, true) then
local background = plr.PlayerGui.ModCall.Background
background.Call.Visible = false
background.Reason.PlaceholderText = "You are blacklisted from using this, appeal in the discord."
background.Reason.PlaceholderColor3 = Color3.new(0,0,0)
background.Subtitle.Text = "Your are blacklisted"
end
end)