Ad
Log in to vote
-1

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

Asked by 7 days 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 198 — 7d
0
what then EpicAshtonTheBoy 25 — 7d

1 answer

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

Answer this question



Ad