Attempting to access "Players" results in a nil value

Back
owo_pounce
Join Date:
Posts:
Jan 2022
2
5 months ago | 24 • By owo_pounce

This code is taken straight from the Polytoria API docs, but when I put it into a script (stored in ScriptService), it throws an error and says that it's "attempting to call a nil value". What am I getting wrong here?


game["Players"].PlayerAdded:Connect(function (player)
print(player.Name .. " joined the game!")
end)


owo_pounce OP
Join Date:
Posts:
Jan 2022
2
5 months ago • By owo_pounce OP

Never mind, I guess it works now. No clue why though, maybe I'm just bad at Lua lol


Gusman
Join Date:
Posts:
Nov 2022
697
5 months ago • By Gusman

You have a weird name.


Brixster Admin
Join Date:
Posts:
Sep 2019
605
5 months ago • By Brixster

Hmm, this sounds like a bug. let me know if you keep encountering it!



that is all for now. Keep it cool, SWAGSTERS!

Replace Plus Deluxe
Join Date:
Posts:
Sep 2020
2561
5 months ago • By Replace

bug



Join the "Internet Trolls" guild today! ----> https://polytoria.com/guilds/621