Why This script doesn't work?
script:
01 | function hasPass(player,id) |
02 | if game:GetService( "GamePassService" ):PlayerHasPass(player,id) then |
11 | game.Players.PlayerAdded:connect( function (player) |
13 | if hasPass(player, 163409880 ) then |
14 | print (player.Name .. " has the GamePass!" ) |
17 | if game:GetService( "BadgeService" ):UserHasBadge(p.userId, 93416536 ) then |
18 | print ( "The user has this badge" ) |
21 | game:GetService( "BadgeService" )AwardBadge(p.userId, 93416536 ) end |
23 | else print (player.Name .. " doesn't have the GamePass" ) |
it suppose to give badge when player has gamepass.
please help me to fix it, thank you very much!