Gamepass script not working

Basically I own the gamepass and it’s not giving me the tool. The script :

-- // Copyright 2023, lambarini, All rights reserved.
local MarketPlaceService = game:GetService("MarketplaceService")
local PlayersService = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local GamepassId = 140028841

PlayersService.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function()
		if MarketPlaceService:UserOwnsGamePassAsync(plr.UserId,GamepassId) then
			local Tool = ReplicatedStorage:WaitForChild("Tools").SpeedCoil:Clone()
			Tool.Parent = plr
		end
	end)
end)

Please someone help asap

2 Likes

Can you add some print functions to your code so you can decipher where things are going wrong? e.g. put print(“player joined”) or print(“character added”) or print (“user owns gamepass”) etc for easier debugging

2 Likes

Oh, this is a simple solution. Please change the following code:

Tool.Parent = plr
-- CHANGE TO
Tool.Parent = plr.Backpack

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.