Ok so basically this is a section of my script that is for a gamepass gui script. I want this to make a textlabel visible if they own the gamepass, but it's not becoming visible for me. I'm new to scripting so an explanation would be helpful too!
Here:
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player,productId) then script.Parent.Selectable = false script.Parent.Text = '--' script.Parent.Parent.Owned.Visible = true else script.Parent.Parent.Owned.Visible = false end
Thank you, Amsupr
You need to use RemoteFunction for checking gamepass
--// ServerScript (put RemoteFunction to ReplicatedStorage and change name to CheckGamePass) checkGamePass = game.ReplicatedStorage.CheckGamePass function checkGamePass.OnServerInvoke (plr,ID) return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,ID) end --// LocalScript if game.ReplicatedStorage.CheckGamePass:InvokeServer(GamePassID) then script.Parent.Selectable = false script.Parent.Text = '--' script.Parent.Parent.Owned.Visible = true else script.Parent.Parent.Owned.Visible = false end