Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why do i get player is not a valid member of data model?

local id = 1320213165
game.Player.PlayerAdded:connect(function(plr)
	print("player added")
 if game:GetService('GamePassService'):PlayerHasPass(plr,id)then
	print("player has gamepass")
  plr.PlayerGui.BillboardGui.frame.Tag.Visible = true
print("tag is visible")
else
	print("player doesnt have gamepass")
	plr.PlayerGui.BillboardGui.frame.Tag.Visible = false
	print("tag not visible")
 end
end)

This script is in server script service. Did I do something wrong?

2 comments

0

Line 2 ... game.Players.PlayerAdded:.... not "Player"

0

what then

1 answer

✓ Accepted answer

It's game.Players not game.Player, spelling is important :D

6 comments

0

ok that work i then got another error with line 06 saying biilboardgui is not a valid member when it is

0

i think i fixed it

0

Server scripts cannot access a player's PlayerGui when FilteringEnabled is on.

0

i half fixed

0

i fixed it

0

It's better to use game:GetService('Players') b/c of exploits. :P (Sometimes they change the names of the services)

This discussion is preserved as it was. New answers, comments, and votes are closed.