Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone tell me what this error means?? [I NEED HELP!!]

Asked by 10 years ago

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 answer

Log in to vote
0
Answered by
Bman8765 270 Moderation Voter
10 years ago

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.

0
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. ImmenseKassing 120 — 10y
Ad

Answer this question