So I am trying to script it so that when you click a UI it will say in the console u own the gamepass. For some reason my script is not working but I don’t know why as it says the exact same then the doc on roblox developer hub. (I know I don’t need the Marketplace Service but I am going to make it later so that if u do not have it it will prompt u)
local button = script.Parent
local marketplace = game:GetService("MarketplaceService")
local gamepassplace = game:GetService("GamePassService")
button.MouseButton1Click:Connect(function(plr)
local hasgamepass = gamepassplace:PlayerHasPass(plr, 12226664)
if hasgamepass then
print("Yay u have the gamepass!")
else
print("WHYYYY U DO NOT HAVE THE GAMEPASS!")
end
end)
I would recommend switching to localscript because I don’t think you really have a way of getting the player if the script isnt individual to every player
Where the server script was located but make sure the gui is in a spot where localscripts are ran, playergui (put in startergui), playerscripts, character