I Am Making A Gamepass Script and I Am Trying To Make It So The Players Get The Gamepass Item Without Rejoining The Game Here Is The Script: This Is All In A Server Script btw
local event = game.ReplicatedStorage.RemoteEvents.GamePPP
local gamepassid = 50179266
local last = game.ReplicatedStorage.RemoteEvents.Last
local part = game.Workspace.VIPRoomPurchase
local mps = game:GetService('MarketplaceService')
local function workpls(player, gamepassid, wasPurchased)
local plr = game.Players:GetPlayerFromCharacter(player.Parent)
if plr then
if mps:UserOwnsGamePassAsync(plr.UserId, 50179266) then
print('User Already Owns Gamepass!')
else
game:GetService('MarketplaceService'):PromptGamePassPurchase(plr,50179266)
print('User Prompted To Purchase')
if mps.PromptGamePassPurchaseFinished and wasPurchased == true then
print('Working') -- For Testing
end
end
end
end
part.Touched:Connect(workpls)
