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

Why does this Assign Class script not work?

The script is in the GUI itself. When you click on a class, the tool is supposed to clone and be placed in the player's backpack (until they die, upon which they can choose a new class). Filtering Enabled is on. Help needed.

player = script.Parent.Parent.Parent 
backpack = player.Backpack
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(3454350)
	script.Parent.Main.Visible = false --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 comment

0

It might be the wait(3454350) That's waiting over a week(if I did the math right)

1 answer

If filtering enabled is on you may need a Remotefunction to complete this task.

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