Hello,
I made this script to give a tool to a player if they own a gamepass when they join the game. That part works fine. The problem is that if the player resets, they don't get the tool back. I tried to use a PlayerAdded event, but it doesn't seem to work.
Here is my script:
game.Players.PlayerAdded:Connect(function(plr)
local ID = plr.UserId
wait()
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(ID, 4726509) then
plr:WaitForChild("Backpack",50)
local boomclo = game.ServerStorage.Tools.BoomBox:Clone()
boomclo.Parent = plr.Backpack
plr.CharacterAdded:Connect(function(char)
local boomclo = game.ServerStorage.Tools.BoomBox:Clone()
boomclo.Parent = plr.Backpack
end)
else
print("No gamepass!")
end
end)
Help would be appreciated.
Thanks!

1 comment
That was a poorly worded title I am now realizing.