Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 6 years ago
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?

0
Line 2 ... game.Players.PlayerAdded:.... not "Player" arshad145 392 — 6y
0
what then EpicAshtonTheBoy 33 — 6y

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
6 years ago

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

0
ok that work i then got another error with line 06 saying biilboardgui is not a valid member when it is EpicAshtonTheBoy 33 — 6y
0
i think i fixed it EpicAshtonTheBoy 33 — 6y
0
Server scripts cannot access a player's PlayerGui when FilteringEnabled is on. UgOsMiLy 1074 — 6y
0
i half fixed EpicAshtonTheBoy 33 — 6y
View all comments (2 more)
0
i fixed it EpicAshtonTheBoy 33 — 6y
0
It's better to use `game:GetService('Players')` b/c of exploits. :P (Sometimes they change the names of the services) TheeDeathCaster 2368 — 6y
Ad

Answer this question