How would I make it so after the player buys the gamepass it fires the clien??
Event.OnServerEvent:Connect(function(plr)
if MarketplaceService:UserOwnsGamePassAsync(plr.UserId, GamepassID) then
plr.axes.Invisaxe.Value = true
ReplicatedStorage.OnJoin.Invisaxe1:FireClient()
else
MarketplaceService:PromptGamePassPurchase(plr, GamepassID)
end
end)
Use MarketplaceService.PromptGamePassPurchaseFinished. Like this:
Event.OnServerEvent:Connect(function(plr)
if MarketplaceService:UserOwnsGamePassAsync(plr.UserId, GamepassID) then
plr.axes.Invisaxe.Value = true
ReplicatedStorage.OnJoin.Invisaxe1:FireClient()
else
MarketplaceService:PromptGamePassPurchase(plr, GamepassID)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, purchased)
if player ~= plr or not purchased or gamePassId ~= GamePassID then
return
end
-- Guessing that you want to do the same you do when the player originally owns the gamepass.
plr.axes.Invisaxe.Value = true
ReplicatedStorage.OnJoin.Invisaxe1:FireClient()
end)
end
end)
Event.OnServerEvent:Connect(function(plr)
if MarketplaceService:UserOwnsGamePassAsync(plr.UserId, GamepassID) then
plr.axes.Invisaxe.Value = true
ReplicatedStorage.OnJoin.Invisaxe1:FireClient(plr)
else
MarketplaceService:PromptGamePassPurchase(plr, GamepassID)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, purchased)
if player ~= plr or not purchased or gamePassId ~= GamePassID then
return
end
-- Guessing that you want to do the same you do when the player originally owns the gamepass.
plr.axes.Invisaxe.Value = true
ReplicatedStorage.OnJoin.Invisaxe1:FireClient(plr)
end)
end
end)