Hey, i am making gamepass that will give you a tool if you own it, but the problem is that it is not giving the tool.
here is the code i wrote:
local mp = game:GetService("MarketplaceService")
local id = -- my id is here
local tool = "HK33"
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
if mp:UserOwnsGamePassAsync(plr.UserId, id) then
print("you're")
script[tool]:Clone().Parent = plr.Backpack
end
end)
end)
local MarketplaceService = game:GetService("MarketplaceService")
local Gamepass = 0
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, Gamepass) then
local Tool = script["Tool"]:Clone()
Tool.Parent = Player.Backpack
end
end)
end)