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

How to award points once with Game Pass?

Asked by
TofuBytes 500 Moderation Voter
10 years ago

I'm trying to figure out the problem with my script. It should award the player 135 Coins if they have the game pass and their coin value is 0. Does anyone know what might be the problem?

local ID = 93015762
local Player = game.Players.LocalPlayer

Game.Players.PlayerAdded:connect(function(Player)
      if Game:GetService("GamePassService"):PlayerHasPass(Player, ID) then
        if Player.leaderstats.Coins.Value == 0 then
                Player.leaderstats.Coins.Value = Player.leaderstats.Coins.Value + 135
      else
        print("User already been awarded Coins")
                end
        end
end)

Answer this question