For some reason the "game.Players" is nil in my local script

In my script, for some reason, starting at line 200, any code that has “game.Players” will be nil, regardless of whether it’s a variable or not.
Can someone help me?

Error: Players.xBieel_z.Backpack.Katana.ToolActivator:221: attempt to index nil with 'Players' - Client - ToolActivator:221

For future reference, use game:GetService.

local Players = game:GetService("Players")

It seems like game is nil in your script. Did you redefine game?

Oh, thank you very much for the reply, but i already fixed the error. It was a metatable above the line that was giving the error.

1 Like