Attempting to access "Players" results in a nil value

Back
owo_pounce
Join Date:
Posts:
Jan 2022
2
11 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
11 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


WaterMelon1
Join Date:
Posts:
Nov 2022
795
11 months ago • By WaterMelon1

You have a weird name.


Brixster Plus Deluxe
Join Date:
Posts:
Sep 2019
827
11 months ago • By Brixster

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



Polytoria

Coolness
Join Date:
Posts:
Streak:
Sep 2020
3206
9 days
11 months ago • By Coolness 9d

bug