Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

script wont make a imagelabel in screengui turn visible if gamepass is owned?

local passId = 9194387
game.Players.PlayerAdded:Connect(function(player)
	player:WaitForDataReady()
	if game:GetService("GamePassService"):PlayerOwnsPass(player,passId) then
			player.PlayerGui.StandardDice.ExtraDie.Visible = true
	else
		print(player.Name .. " does not have the extra die pass.")
	end
end)

This script is in ServerScriptService

1 answer

✓ Accepted answer

Try to use

local MarketplaceService = game:GetService("MarketplaceService")
local passId = 9194387
game.Players.PlayerAdded:Connect(function(player)
    player:WaitForDataReady()
    if MarketplaceService:UserOwnsGamePassAsync(player.UserId, passId) then
            player.PlayerGui.StandardDice.ExtraDie.Visible = true
    else
        print(player.Name .. " does not have the extra die pass.")
    end
end)

2 comments

0

Thank you so much! This is a very important aspect for my game!

0

No problem!

This discussion is preserved as it was. New answers, comments, and votes are closed.