Ad
Log in to vote
-1

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

Asked by 3 months 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 240 — 3mo
0
what then EpicAshtonTheBoy 33 — 3mo

1 answer

Log in to vote
0
Answered by
RubenKan 2803 Administrator
3 months 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 — 3mo
0
i think i fixed it EpicAshtonTheBoy 33 — 3mo
0
Server scripts cannot access a player's PlayerGui when FilteringEnabled is on. UgOsMiLy 964 — 3mo
0
i half fixed EpicAshtonTheBoy 33 — 3mo
View all comments (2 more)
0
i fixed it EpicAshtonTheBoy 33 — 3mo
0
It's better to use `game:GetService('Players')` b/c of exploits. :P (Sometimes they change the names of the services) TheeDeathCaster 1962 — 3mo
Ad

Answer this question



Ad