--tables

local SoundTable = {}
local AnimTable = {}


local function PickThing(ThingToPick)
	if ThingToPick == "Swing" then
		--pick anim
		local SwingA = AnimTable[R:NextInteger(1, #AnimTable)]
		local findA = Tool.Animations:findFirstChild(SwingA)
		return findA
	elseif ThingToPick == "Sound" then
		--pick sound
		local SoundA = SoundTable[R:NextInteger(1, #SoundTable)]
		local findA = Tool.Sounds:findFirstChild(SoundA)
		return findA
	end
end

 --check if trables have been filled
function CheckTables()
	if LoadedTables == false then
		local GetS = Tool.Sounds:GetChildren()
		local GetA = Tool.Animations:GetChildren()
		for i = 1, #GetS do
			if GetS[i].Name ~= "Equip" then --ignore equip sound
				table.insert(SoundTable, tostring(GetS[i].Name))
			end
		end
		for i = 1, #GetA do
			if GetA[i].Name ~= "Equip" then --ignore equip animation
				table.insert(AnimTable, tostring(GetA[i].Name))
			end
		end
		LoadedTables = true
	end
end
