Hi guys, i have made this script for my gamepass but if the player does’nt have gamepass, the windows for prompt gamepass not showing… it’s a script not localscript:
local id = 8535327
local MarketplaceService = game:GetService("MarketplaceService")
if MarketplaceService:UserOwnsGamePassAsync(plr.UserId,id) then
plr.PlayerGui.Teleporter.Frame.Visible = true
plr.PlayerGui.Teleporter.Framed.Visible = true
else
game:GetService("MarketplaceService"):PromptGamePassPurchase(plr, id)
end
it’s not all code, just the part of my gamepass, if palyer have gamepass the Frame is visible it’s working good, but if the player don’t have gamepass i don’t have the prompt window
traveler.OnServerEvent:Connect(function(plr, tool)
local mag = (tool:WaitForChild("Handle").Position - plr.Character.PrimaryPart.Position).magnitude
if mag < 10 then
local id = 8535327
local MarketplaceService = game:GetService("MarketplaceService")
if MarketplaceService:UserOwnsGamePassAsync(plr.UserId,id) then
plr.PlayerGui.Teleporter.Frame.Visible = true
plr.PlayerGui.Teleporter.Framed.Visible = true
else
print("test")
game:GetService("MarketplaceService"):PromptGamePassPurchase(plr, id)
end
end
end)
I have solved my problem, i have replace the line else by elseif not gamepass… and it’s working !
But i have another problem xd if player has gamepass the frame show correctly, but just one times, if i press “E” the frame will not be visible in second time…