How would I clone a tool to the player's backpack even after reset?

Hi there, I have a script that clones a tool to a player’s backpack when their team is changed to this team or this team. The problem is, is that after they reset as that team it is no longer in their backpack. I have tried creating the same script but without the getpropertychangedsignal however that didn’t work.

local teams = game:GetService("Teams")

game.Players.PlayerAdded:Connect(function(player)
	local tool = game.ReplicatedStorage.Railgun:Clone()	
	
	player:GetPropertyChangedSignal("Teams"):Connect(function()
		if player.Team == teams["Red"] then
			tool.Parent = player.Backpack
		end

		if player.Team == teams["Blue"] then
			tool.Parent = player.Backpack
		end
	end)
end)
game.Players.PlayerAdded:Connect(function(plr)
   plr.CharacterAdded:Connect(function(char)
       local hum = char:WaitForChild("Humanoid")
       hum.Died:Connect(function()
           --code here
       end)
   end)
end)

There’s actually an easier built-in solution. StarterGear will automatically clone everything inside into the Backpack, similarly to StarterGui for PlayerGui.

Keep in mind that when you clone something into the StarterGear, it will only clone to the Backpack when they respawn. This means that you’ll also have to clone the tools into the player’s Backpack the first time you do so. Alternatively, if these items will exist from the start of the game, you can use the StarterPack.

1 Like

The thing is, is that I’m making it so only a team can have that tool. And with starterpack, it will clone to every player regardless.

Then as explained in my previous reply, StarterGear is what you’re looking for.

ohh, sorry I misread that.

Thanks, that worked!

1 Like