hello, I'm trying to create a gamepass shop using a regular script, but multiple attempts have been made and I can't get it to work. Here is the script:
local tool = game.Lighting:findFirstChild("LinkedRocketLauncher")
local button = script.Parent
local player = game.Players.LocalPlayer
local Value = script.Parent.Gamepass
function buy()
if button.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, Value.Value)
local a = tool:clone()
a.Parent = player.Backpack
local b = tool:clone()
b.Parent = player.StarterGear
end
end
script.Parent.MouseButton1Down:connect(buy)
please help.
