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

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

Asked by 4 years ago
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

Log in to vote
0
Answered by 4 years ago

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)
0
Thank you so much! This is a very important aspect for my game! Jakob_Cashy 79 — 4y
0
No problem! GalaxySMediaXz 32 — 4y
Ad

Answer this question