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

i made this gui button to be visible if the user has gampass, whats wrong?

local id = 8672917 local player = game.Players.LocalPlayer

if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, id) then

script.Parent.Visible = true

else script.Parent.Visible = false end

it wont work whats wrong ?

1 answer

✓ Accepted answer

Simple mistake! Here, I fixed it:

local id = 8672917 
local player = game.Players.LocalPlayer

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id) then -- It should be UserOwnsGamePassAsync() for Game Passes, and it requires the players UserId
	script.Parent.Visible = true
else 
	script.Parent.Visible = false 
end

Be sure to accept this answer if this helps!

1 comment

0

thanks

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