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)

2 comments

0

I would use MarketplaceService instead of GamePassService

0

I tried that but it does the same thing.