Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this Assign Class script not work?

Asked by 9 years ago

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.

01player = script.Parent.Parent.Parent
02backpack = player.Backpack
03function chooseClass(class)
04    for i, v in pairs(backpack:GetChildren()) do v:remove() end
05    for i, v in pairs(class:GetChildren()) do
06        if v:IsA("Tool") then
07            v:clone().Parent = backpack
08        elseif v:IsA("HopperBin") then
09            v:clone().Parent = backpack
10        end
11    end
12    script.Parent.Main.Visible = false --no new class for a little bit
13    wait(3454350)
14    script.Parent.Main.Visible = false --allow to pick a different class
15end
16 
17for i, v in pairs(script.Parent.Main:GetChildren()) do
18    v.MouseButton1Up:connect(function () chooseClass(v) end)
19end
0
It might be the wait(3454350) That's waiting over a week(if I did the math right) theCJarmy7 1293 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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

Ad

Answer this question