Script not giving gun after gamepass bought

Hi there,

So I am trying to create a gamepass shop for my game. I have the GUI and everything setup, The issue I am having is it is not giving the player the gun.

This is the local script inside the purchase button which works. It brings the purchase GUI up.
Screenshot_112

This is in ServerScriptService which should give it the gun when respawned but it does not.

Can anyone help ?

Its CharacterAdded and not characterAdded.
Also the prompt script should preferably be a script.

Try: Player.CharacterAdded, you just forgot to capitalize it

1 Like

Unfortunately, Marketplace Service doesn’t cache whether or not a user owns a gamepass after they’ve bought it in game. You probably want to use an event called “PromptGamePassPurchaseFinished,” Which is fired directly after a player purchases a gamepass in the game. You can read more about it here:

https://developer.roblox.com/en-us/api-reference/event/MarketplaceService/PromptGamePassPurchaseFinished

1 Like

In which script would I add it ? The one in ServerScriptService, or in the purchase script ?
(Edit) FIxed, Thank you everyone!

1 Like

Just wait, caching is to be removed from MarketplaceService soon from the release notes.

1 Like