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?
Well a nil values means the value doesn't exist. For example, if I made a script like so:
gui.Visible = false
I would get a nil value because gui is variable that has not been defined before the script calls for it. I recommend checking over everything to make sure it's not a "nil value". Also if you could tells us which line the output console says this is happening on that would make our life's easier.