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

Can someone help with putting 2 "for loops" inside another?

Asked by 4 years ago

This script is a server-script, inside of my StarterCharacter scripts. I know that HopperBin is deprecated, but I just found a server-script from the Roblox library that kicked anyone that had it, and it worked. But I want to be more specific on the BinType so . . .

This is my code so far. The code may look broken off so just look at the source:

local BtoolTypes = {"Hammer", "Clone", "Grab"}

while true do
    wait(10)
    for i, v in 
pairs(game:GetService("Players"):GetPlayerFromCharacter(script.Parent).Backpack:GetChildren()) do
        if v:IsA("HopperBin") then
            for i = 1, #BtoolTypes do
                if v.BinType == BtoolTypes[i] then
                    game:GetService("Players"):GetPlayerFromCharacter(script.Parent):Kick()
                end
            end
        end
    end 
end

Can anyone help?

0
may i know if there is there any error? guest_20I8 266 — 4y
0
no errors FatTurtleNugget 0 — 4y

Answer this question