So, I made this script that's supposed to block the player's screen and kick them.
game.Players.PlayerAdded:connect(function(player)
if player.Name == "Player1" then
screenGui = Instance.new("ScreenGui", player.PlayerGui)
textbox = Instance.new("TextBox", screenGui)
textbox.BackgroundColor3 = Color3.new(255,0,0)
textbox.Size = UDim2.new(1,0,1,0)
textbox.Text = "No one wants you here."
wait(.1)
player:Remove()
end
end)
But it keeps coming up with this error: 19:32:46.149 - CoreGui.RobloxGui.CoreScripts/Settings:410: attempt to index a nil value Could someone tell me what it means?

1 comment
Bman, this has not helped at all. I've checked everything over before, there is not a nil value. And I DON'T know what line it's on. It doesn't say! THIS is what I needed help with. I know what it means when it says a value is nil, but nothing of the part before it. I was needing help figuring out of what the error meant, you didn't help at all.