Soo i'm trying to make a script where if you have bought a certain pass, it gives you a tool
script:
local coilButton = script.Parent.CoilButton
local coil = game.ReplicatedStorage.BootlegCoil
local coilId = 9517388
local MS = game:GetService("MarketplaceService")
local GS = game:GetService("GamePassService")
local player = game.Players.LocalPlayer
local function promptGamepass()
MS:PromptGamePassPurchase(player, coilId)
end
local function checkGamepasses()
if GS:PlayerHasPass(player, coilId) then
print("player has coil!")
local clone = coil:Clone()
if clone.Parent ~= player.Backpack then
clone.Parent = player.Backpack
end
end
end
coilButton.MouseButton1Click:Connect(promptGamepass)
game.Players.PlayerAdded:Connect(checkGamepasses)
Can someone tell me why check gamepasses function is not giving me the tool and not printing anything?
