Attempting to call a nil value

I want to modify my text label located in a ScreenGui during a game and then this happens:
The script:

for _,player in pairs(Players:GetPlayers()) do -- This is normally line 11 in my script
	player.PlayerGui.ScreenGui.Details.Text = "Some random text"
end

P.S. : This is the player variable: image

Here is the error I am getting:
image

Any help would be appreciated. Thanks!

Hey guys I just realised stupid me mentioned :GetPlayers() twice both in variable and in the pairs loop can you flag it so it gets deleted?

Just delete it urself please don’t busy the staff for no reason. Be independent

Wish I could.
image

Sadly its not part of flagging it reason
its not inappropriate
its not off topic
its not spam

Just flag it for something else.

Reason? i need why u want to flag this

there’s post that was solved by people themselves. Everyone makes mistakes, in fact it is good you managed to find the mistake yourself. Its normal, just leave this post like this since if anybody makes the same mistake you did ,they can refer to this instead of posting another topic.

ok thanks heres a cookie :cookie: