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

GamePassService doesn't give the perks that i want?

Asked by 6 years ago

If you own a cetain gamepass and join the game, you should be able to get a custom billboardgui tag on your head and some currency called 'gems'. But for some reason it seems to be working the oppsite way around. I already own the specific gamepass, but when i join the game, it gives me the "else" option instead of the perk. When i switch it, it seems to give me the perks i wanted. I don't know if i'm doing something wrong.

local donorHeadGui = game:GetService("ServerStorage"):WaitForChild("DonorHeadGui")
local id = 4391942

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)

if game:GetService("GamePassService"):PlayerHasPass(player, id) then    
    local clonedGui = donorHeadGui:Clone()
    wait(5)
    local gems = player.leaderstats:WaitForChild("Gems")
        clonedGui.Parent = game.Workspace:WaitForChild(player.Name)
        clonedGui.Adornee = game.Workspace:WaitForChild(player.Name).Head
        clonedGui.Enabled = true
        gems.Value = gems.Value + 25
    else
        print("This Player does not own the Donor Gamepass!")
    end
end)
end)
0
I would use MarketplaceService instead of GamePassService zblox164 531 — 6y
0
I tried that but it does the same thing. BrawlBattle 15 — 6y

Answer this question