If the player has the gamepass id, then I want them to get a weapon but it is not working. When you are in game and you press on the gui button, another gui is suppose to come up saying if you would want to buy it. It does not show up ;(
local Player = game.Players.LocalPlayer
local ID = script.Parent.GamePassID.Value
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.PromptPurchaseFinished:connect(function(Player, ID, isPurchased)
if isPurchased then
local Weapon = game.ServerStorage['Rocket Launcher']
Weapon:Clone().Parent = Player.Backpack
Weapon:Clone().Parent = Player.StarterPack
else
print(Player.Name.. " does not own the ID of " .. ID)
end
end)

4 comments
Local Script? You can't access ServerStorage with Local Scripts. Server Script? You can't use LocalPlayer in Server Scripts.
It suppose to print Player1 does not own the ID of... and it does not print that, which it should because I don
't own the Id
Get rid of line 1, which is the local player. And if it is a local script, copy and paste it into a server script.