my code:local button = script.Parent
local player = game.Players.LocalPlayer
local gamePassId = script.Parent.GamepassId
button.MouseButton1Click:connect(function()
if player then
game:GetService(“MarketplaceService”):PromptGamePassPurchase(player, gamePassId.Value)
local player = game.Players.LocalPlayer
local ownsGamepass = game:GetService(“MarketplaceService”):UserOwnsGamePassAsync(player.UserId,38706262)
if ownsGamepass then
local sword = game:GetService("ReplicatedStorage"):WaitForChild("SpeedCoil"):Clone()
sword.Parent = player.Backpack
end
end
end)