Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

this old script removes pre existing tools?

i found an old (2011) free model script that still works. i just want to change one thing... it removes the tools from ur current backpack.. witch conflicts with my current gamepass tools scripts where u spawn with them. can somoene make it not remove the gears from ur backpack once you select a class?

--Do NOT and I mean NOT touch anything in this script! Ya heard!
player = script.Parent.Parent.Parent -- no touchie
backpack = player.Backpack -- no touchie

function chooseClass(class)
	for i, v in pairs(backpack:GetChildren()) do v:remove() end
	for i, v in pairs(class:GetChildren()) do
		if v:IsA("Tool") then
			v:clone().Parent = backpack
		elseif v:IsA("HopperBin") then
			v:clone().Parent = backpack
		end
	end
	script.Parent.Main.Visible = false --no new class for a little bit
	wait(600000)
	script.Parent.Main.Visible = true --allow to pick a different class
end

for i, v in pairs(script.Parent.Main:GetChildren()) do
	v.MouseButton1Up:connect(function () chooseClass(v) end)
end

1 answer

✓ Accepted answer

Simply remove line 6, its the line that removes all children of backpack(where the player's tools are held)

for i, v in pairs(backpack:GetChildren()) do v:remove() end

This one

2 comments

0

thanks

0

Heya virushunter9! You sound familiar.

This discussion is preserved as it was. New answers, comments, and votes are closed.