As the titles says, I have a gamepass that continues to give you the tools everytime you reset and die, filling up the bag/inventory. How should I fix this?
Thanks for the help in advance.
local gamepass = script:WaitForChild("GamePassId")
local service = game:GetService("GamePassService")
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
if service:PlayerHasPass(player,gamepass.Value) then
local tools = game.ReplicatedStorage:WaitForChild("Gamepass")
for i,v in pairs(tools:getChildren()) do
if v:isA("Tool") then
v:Clone().Parent = player:WaitForChild("Backpack")
v:Clone().Parent = player:WaitForChild("StarterGear")
end
end
end
end)
end)

1 comment
Wouldn't you have a empty backpack when you respawn?